Returns the template variables in key value format

@param array data
@return array
438403
public function getVariables() 
	{
		if(empty($this->countries)) {
			$this->countries = array(
				'GB' => 'United Kingdom',					'US' => 'United States',
				'AF' => 'Afghanistan',						'AL' => 'Albania',
				'DZ' => 'Algeria',							'AS' => 'American Samoa',
				'AD' => 'Andorra',							'AO' => 'Angola',
				'AI' => 'Anguilla',							'AQ' => 'Antarctica',
				'AG' => 'Antigua And Barbuda',				'AR' => 'Argentina',
				'AM' => 'Armenia',							'AW' => 'Aruba',
				'AU' => 'Australia',						'AT' => 'Austria',
				'AZ' => 'Azerbaijan',						'BS' => 'Bahamas',
				'BH' => 'Bahrain',							'BD' => 'Bangladesh',
				'BB' => 'Barbados',							'BY' => 'Belarus',
				'BE' => 'Belgium',							'BZ' => 'Belize',
				'BJ' => 'Benin',							'BM' => 'Bermuda',
				'BT' => 'Bhutan',							'BO' => 'Bolivia',
				'BA' => 'Bosnia And Herzegowina',			'BW' => 'Botswana',
				'BV' => 'Bouvet Island',					'BR' => 'Brazil',
				'IO' => 'British Indian Ocean Territory',	'BN' => 'Brunei Darussalam',
				'BG' => 'Bulgaria',							'BF' => 'Burkina Faso',
				'BI' => 'Burundi',							'KH' => 'Cambodia',
				'CM' => 'Cameroon',							'CA' => 'Canada',
				'CV' => 'Cape Verde',						'KY' => 'Cayman Islands',
				'CF' => 'Central African Republic',			'TD' => 'Chad',
				'CL' => 'Chile',							'CN' => 'China',
				'CX' => 'Christmas Island',					'CC' => 'Cocos (Keeling) Islands',
				'CO' => 'Colombia',							'KM' => 'Comoros',
				'CG' => 'Congo',							'CD' => 'Congo, The Democratic Republic Of The',
				'CK' => 'Cook Islands',						'CR' => 'Costa Rica',
				'CI' => 'Cote D\'Ivoire',					'HR' => 'Croatia (Local Name: Hrvatska)',
				'CU' => 'Cuba',								'CY' => 'Cyprus',
				'CZ' => 'Czech Republic',					'DK' => 'Denmark',
				'DJ' => 'Djibouti',							'DM' => 'Dominica',
				'DO' => 'Dominican Republic',				'TP' => 'East Timor',
				'EC' => 'Ecuador',							'EG' => 'Egypt',
				'SV' => 'El Salvador',						'GQ' => 'Equatorial Guinea',
				'ER' => 'Eritrea',							'EE' => 'Estonia',
				'ET' => 'Ethiopia',							'FK' => 'Falkland Islands (Malvinas)',
				'FO' => 'Faroe Islands',					'FJ' => 'Fiji',
				'FI' => 'Finland',							'FR' => 'France',
				'FX' => 'France, Metropolitan',				'GF' => 'French Guiana',
				'PF' => 'French Polynesia',					'TF' => 'French Southern Territories',
				'GA' => 'Gabon',							'GM' => 'Gambia',
				'GE' => 'Georgia',							'DE' => 'Germany',
				'GH' => 'Ghana',							'GI' => 'Gibraltar',
				'GR' => 'Greece',							'GL' => 'Greenland',
				'GD' => 'Grenada',							'GP' => 'Guadeloupe',
				'GU' => 'Guam',								'GT' => 'Guatemala',
				'GN' => 'Guinea',							'GW' => 'Guinea-Bissau',
				'GY' => 'Guyana',							'HT' => 'Haiti',
				'HM' => 'Heard And Mc Donald Islands',		'VA' => 'Holy See (Vatican City State)',
				'HN' => 'Honduras',							'HK' => 'Hong Kong',
				'HU' => 'Hungary',							'IS' => 'Iceland',
				'IN' => 'India',							'ID' => 'Indonesia',
				'IR' => 'Iran (Islamic Republic Of)',		'IQ' => 'Iraq',
				'IE' => 'Ireland',							'IL' => 'Israel',
				'IT' => 'Italy',							'JM' => 'Jamaica',
				'JP' => 'Japan',							'JO' => 'Jordan',
				'KZ' => 'Kazakhstan',						'KE' => 'Kenya',
				'KI' => 'Kiribati',							'KP' => 'Korea, Democratic People\'s Republic Of',
				'KR' => 'Korea, Republic Of',				'KW' => 'Kuwait',
				'KG' => 'Kyrgyzstan',						'LA' => 'Lao People\'s Democratic Republic',
				'LV' => 'Latvia',							'LB' => 'Lebanon',
				'LS' => 'Lesotho',							'LR' => 'Liberia',
				'LY' => 'Libyan Arab Jamahiriya',			'LI' => 'Liechtenstein',
				'LT' => 'Lithuania',						'LU' => 'Luxembourg',
				'MO' => 'Macau',							'MK' => 'Macedonia, Former Yugoslav Republic Of',
				'MG' => 'Madagascar',						'MW' => 'Malawi',
				'MY' => 'Malaysia',							'MV' => 'Maldives',
				'ML' => 'Mali',								'MT' => 'Malta',
				'MH' => 'Marshall Islands',					'MQ' => 'Martinique',
				'MR' => 'Mauritania',						'MU' => 'Mauritius',
				'YT' => 'Mayotte',							'MX' => 'Mexico',
				'FM' => 'Micronesia, Federated States Of',	'MD' => 'Moldova, Republic Of',
				'MC' => 'Monaco',							'MN' => 'Mongolia',
				'MS' => 'Montserrat',						'MA' => 'Morocco',
				'MZ' => 'Mozambique',						'MM' => 'Myanmar',
				'NA' => 'Namibia',							'NR' => 'Nauru',
				'NP' => 'Nepal',							'NL' => 'Netherlands',
				'AN' => 'Netherlands Antilles',				'NC' => 'New Caledonia',
				'NZ' => 'New Zealand',						'NI' => 'Nicaragua',
				'NE' => 'Niger',							'NG' => 'Nigeria',
				'NU' => 'Niue',								'NF' => 'Norfolk Island',
				'MP' => 'Northern Mariana Islands',			'NO' => 'Norway',
				'OM' => 'Oman',								'PK' => 'Pakistan',
				'PW' => 'Palau',							'PA' => 'Panama',
				'PG' => 'Papua New Guinea',					'PY' => 'Paraguay',
				'PE' => 'Peru',								'PH' => 'Philippines',
				'PN' => 'Pitcairn',							'PL' => 'Poland',
				'PT' => 'Portugal',							'PR' => 'Puerto Rico',
				'QA' => 'Qatar',							'RE' => 'Reunion',
				'RO' => 'Romania',							'RU' => 'Russian Federation',
				'RW' => 'Rwanda',							'KN' => 'Saint Kitts And Nevis',
				'LC' => 'Saint Lucia',						'VC' => 'Saint Vincent And The Grenadines',
				'WS' => 'Samoa',							'SM' => 'San Marino',
				'ST' => 'Sao Tome And Principe',			'SA' => 'Saudi Arabia',
				'SN' => 'Senegal',							'SC' => 'Seychelles',
				'SL' => 'Sierra Leone',						'SG' => 'Singapore',
				'SK' => 'Slovakia (Slovak Republic)',		'SI' => 'Slovenia',
				'SB' => 'Solomon Islands',					'SO' => 'Somalia',
				'ZA' => 'South Africa',						'GS' => 'South Georgia, South Sandwich Islands',
				'ES' => 'Spain',							'LK' => 'Sri Lanka',
				'SH' => 'St. Helena',						'PM' => 'St. Pierre And Miquelon',
				'SD' => 'Sudan',							'SR' => 'Suriname',
				'SJ' => 'Svalbard And Jan Mayen Islands',	'SZ' => 'Swaziland',
				'SE' => 'Sweden',							'CH' => 'Switzerland',
				'SY' => 'Syrian Arab Republic',				'TW' => 'Taiwan',
				'TJ' => 'Tajikistan',						'TZ' => 'Tanzania, United Republic Of',
				'TH' => 'Thailand',							'TG' => 'Togo',
				'TK' => 'Tokelau',							'TO' => 'Tonga',
				'TT' => 'Trinidad And Tobago',				'TN' => 'Tunisia',
				'TR' => 'Turkey',							'TM' => 'Turkmenistan',
				'TC' => 'Turks And Caicos Islands',			'TV' => 'Tuvalu',
				'UG' => 'Uganda',							'UA' => 'Ukraine',
				'AE' => 'United Arab Emirates',				'UM' => 'United States Minor Outlying Islands',
				'UY' => 'Uruguay',							'UZ' => 'Uzbekistan',
				'VU' => 'Vanuatu',							'VE' => 'Venezuela',
				'VN' => 'Viet Nam',							'VG' => 'Virgin Islands (British)',
				'VI' => 'Virgin Islands (U.S.)',			'WF' => 'Wallis And Futuna Islands',
				'EH' => 'Western Sahara',					'YE' => 'Yemen',
				'YU' => 'Yugoslavia',						'ZM' => 'Zambia',
				'ZW' => 'Zimbabwe');
		}
		
		return array(
			'pattern' => $this->pattern,
			'fields' => $this->show,
			'labels' => $this->labels,
			'data' => $this->data,
			'errors' => $this->errors,
			'holders' => $this->holders,
			'states' => $this->states,
			'regions' => $this->regions,
			'required' => $this->required,
			'neighborhoods' => $this->neighborhoods,
			'countries' => $this->countries);
	}
1093914
protected function getTemplateStrings()
    {
        $default = 'Expected {{actual}} to have a{{deep}}property {{key}}';
        $negated = 'Expected {{actual}} to not have a{{deep}}property {{key}}';

        if ($this->getValue() && $this->isActualValueSet()) {
            $default = 'Expected {{actual}} to have a{{deep}}property {{key}} of {{value}}, but got {{actualValue}}';
            $negated = 'Expected {{actual}} to not have a{{deep}}property {{key}} of {{value}}';
        }

        $deep = ' ';
        if ($this->isDeep()) {
            $deep = ' deep ';
        }

        return str_replace('{{deep}}', $deep, [$default, $negated]);
    }
851686
private static function get_key($template)
    {
        static $_is_stringy = array('string' => true, 'eval' => true);
        // calculate Uid if not already done
        if ($template->source->uid == '') {
            $template->source->filepath;
        }
        $key = $template->source->uid;
        if (isset(self::$template_data[$key])) {
            return $key;
        } else {
            if (isset($_is_stringy[$template->source->type])) {
                self::$template_data[$key]['name'] = '\'' . substr($template->source->name, 0, 25) . '...\'';
            } else {
                self::$template_data[$key]['name'] = $template->source->filepath;
            }
            self::$template_data[$key]['compile_time'] = 0;
            self::$template_data[$key]['render_time'] = 0;
            self::$template_data[$key]['cache_time'] = 0;

            return $key;
        }
    }
1173306
function &get_template_vars($name=null)
	{
		if(!isset($name)) {
			return $this->_tpl_vars;
		} elseif(isset($this->_tpl_vars[$name])) {
			return $this->_tpl_vars[$name];
		} else {
			// var non-existant, return valid reference
			$_tmp = null;
			return $_tmp;
		}
	}
648445
public function getTemplateVars($override = array())
    {
        $this->templateVars['implView'] = $this->innerView;
        $this->templateVars['cssIdentifier'] = $this->cssIdentifier;
        $this->templateVars['cssClass'] = $this->cssClass;
        $this->templateVars['jsClass'] = $this->jsClass;
        $this->templateVars['htmlAttributes'] = $this->htmlAttributes;
        $this->templateVars['jsNamespace'] = $this->jsNamespace;
        $this->templateVars['implOverride'] = $override;

        $innerTemplateVars = $this->innerView->getTemplateVars($override);

        $this->templateVars['clientSideProperties'] = array();
        foreach ($this->getClientSideProperties() as $name) {
            $this->templateVars['clientSideProperties'][$name] = $innerTemplateVars[$name];
        }

        $this->templateVars['clientSideParameters'] = array();
        foreach ($this->getClientSideParameters() as $name) {
            $this->templateVars['clientSideParameters'][$name] = $innerTemplateVars[$name];
        }

        return parent::getTemplateVars($override);
    }
1044889
def extract_vars(template):
    
    keys = set()
    for match in re.finditer(r"\{\{ (?P<key>\w+) \}\}", template.getvalue()):
        keys.add(match.groups()[0])
    return sorted(list(keys))
1295999
protected function getFields($data)
    {
        if (is_array($data)) {
            $fields = $data;
        } else {
            $this->checkData($data);
            $fields = $data->fields();
        }

        return $fields;
    }
250310
public function getPrimaryValues(array $data) : array
    {
        $return = [];
        /** @var Column $column */
        foreach ($this->thead->elements as $column) {
            if ($column instanceof Column && $column->isPrimary()) {
                $return[$column->getId()] = $data[$column->getId()] ?? null;
            }
        }

        return $return;
    }
894598
private function parseTemplateVars($templateContainer)
    {
        $returnArray = [];

        foreach ($templateContainer->getTemplateVars() as $key => $value) {
            switch ($key) {
                case 'order':
                    $this->parseOrderVars($key, $value, $returnArray);
                    break;
                case 'invoice':
                    $this->parseInvoiceVars($key, $value, $returnArray);
                    break;
                case 'creditmemo':
                    $this->parseCreditmemoVars($key, $value, $returnArray);
                    break;
            }
        }

        return $returnArray;
    }
1336252
def variables(template):
    ''''''
    vars = set()
    for varlist in TEMPLATE.findall(template):
        if varlist[0] in OPERATOR:
            varlist = varlist[1:]
        varspecs = varlist.split(',')
        for var in varspecs:
            # handle prefix values
            var = var.split(':')[0]
            # handle composite values
            if var.endswith('*'):
                var = var[:-1]
            vars.add(var)
    return vars
669552
protected function getVariables()
    {
        $reflection = new ReflectionClass($this);
        foreach ($reflection->getProperties(
            ReflectionProperty::IS_PROTECTED |
            ReflectionProperty::IS_PRIVATE |
            ReflectionProperty::IS_STATIC
        ) as $property) {
            $ignore[] = $property->name;
        }
        $values = [];
        foreach ($this as $prop => $value) {
            if (!in_array($prop, $ignore)) {
                if (is_object($value)) {
                    if (method_exists($value, 'jsonSerialize')) {
                        $value = $value->jsonSerialize();
                    } elseif (method_exists($value, 'getArrayCopy')) {
                        $value = $value->getArrayCopy();
                    }
                }
                $values[$prop] = $value;
            }
        }
        return $values;
    }
263655
protected function resolveUseVariables($data)
    {
        foreach ($data as $key => $value) {
            $data[$key] = $this->getRestoredPropertyValue($value);
        }

        return $data;
    }
703846
public function variables() : array
    {
        return [
            'placeholder' => $this->placeholder,
            'icon'        => $this->icon,
            'type'        => $this->type,
            'group'       => $this->filter->group,
        ];
    }
477736
public function getVariables()
    {
        $variables = [];

        if ($this->page->getId()) {
            $variables['cms.identifier'] = $this->page->getIdentifier();
            $variables['cms.title']      = $this->page->getTitle();
        }

        return $variables;
    }
906452
public function getTemplatesArray()
    {
        $templates = $this->getTemplates();

        foreach ($templates as $template) {
            $templates_array[$template->name] = $this->crud->makeLabel($template->name);
        }

        return $templates_array;
    }
911780
public function variables()
    {
        if (!$this->hasKeyword('STUB')) {
            return $this->keyword('HEADING')->values;
        } elseif (!$this->hasKeyword('HEADING')) {
            return $this->keyword('STUB')->values;
        } else {
            return array_merge($this->keyword('STUB')->values, $this->keyword('HEADING')->values);
        }
    }
1110096
public function getData()
    {

        $result = [
            'attachment' => [
                'type' => 'template',
                'payload' => [
                    'template_type' => $this->type
                ]
            ]
        ];

        if (is_array($this->quick_replies)) {
            foreach ($this->quick_replies as $qr) {
                if ($qr instanceof QuickReplyButton) {
                    $result['quick_replies'][] = $qr->getData();
                }
            }
        }

        switch ($this->type)
        {
            case self::TYPE_BUTTON:
                $result['attachment']['payload']['text'] = $this->title;
                $result['attachment']['payload']['buttons'] = [];

                foreach ($this->buttons as $btn) {
                    $result['attachment']['payload']['buttons'][] = $btn->getData();
                }

            break;

            case self::TYPE_GENERIC:
                $result['attachment']['payload']['elements'] = [];
                $result['attachment']['payload']['image_aspect_ratio'] = $this->image_aspect_ratio;

                foreach ($this->elements as $btn) {
                    $result['attachment']['payload']['elements'][] = $btn->getData();
                }
            break;

            case self::TYPE_LIST:
                $result['attachment']['payload']['elements'] = [];
                $result['attachment']['payload']['top_element_style'] = $this->top_element_style;
                //list items button
                foreach ($this->elements as $btn) {
                    $result['attachment']['payload']['elements'][] = $btn->getData();
                }
                //the whole list button
                foreach ($this->buttons as $btn) {
                    $result['attachment']['payload']['buttons'][] = $btn->getData();
                }
            break;

            case self::TYPE_RECEIPT:
                $result['attachment']['payload']['recipient_name'] = $this->recipient_name;
                $result['attachment']['payload']['order_number'] = $this->order_number;
                $result['attachment']['payload']['currency'] = $this->currency;
                $result['attachment']['payload']['payment_method'] = $this->payment_method;
                $result['attachment']['payload']['order_url'] = $this->order_url;
                $result['attachment']['payload']['timestamp'] = $this->timestamp;
                $result['attachment']['payload']['elements'] = [];

                foreach ($this->elements as $btn) {
                    $result['attachment']['payload']['elements'][] = $btn->getData();
                }

                $result['attachment']['payload']['address'] = $this->address->getData();
                $result['attachment']['payload']['summary'] = $this->summary->getData();
                $result['attachment']['payload']['adjustments'] = [];

                foreach ($this->adjustments as $btn) {
                    $result['attachment']['payload']['adjustments'][] = $btn->getData();
                }
            break;
        }


        if ($this->recipient) {
            return [
                'recipient' =>  [
                    'id' => $this->recipient
                ],
                'message' => $result,
                'tag' => $this->tag,
                'notification_type'=> $this->notification_type,
                'messaging_type' => $this->messaging_type
            ];
        } else {
            //share_contents only
            return [
                'attachment' => $result['attachment']
            ];
        }
    }