Return a selection of countries.

@param array $options

@return LibBaseTemplateTag
428773
public function country($options = array())
    {
        $options = new AnConfig($options);

        $options->append(array(
            'id' => 'an-se-selection-countries-'.uniqid(),
            'selected' => null,
            'name' => 'country',
            'use_country_code' => true,
            'prompt' => true,
        ));

        $selected = $options->selected;
        $use_country_code = $options->use_country_code;

        unset($options->selected);
        unset($options->use_country_code);

        $countries = array(
            null => AnTranslator::_('LIB-AN-SELECTOR-SELECT-OPTION'),
        );

        foreach (self::$COUNTRIES as $key => $name) {
            $countries[$use_country_code ? $key : $name] = AnTranslator::_($name);
        }

        return $this->_html->select($options->name, array('options' => $countries, 'selected' => $selected), AnConfig::unbox($options));
    }
1240690
public function listCollections(array $options = [])
    {
        $collections = [];
        foreach ($this->collections as $name => $collection) {
            $collections[] = [
                'name' => $this->name . '.' . $name,
                'options' => $collection['options']
            ];
        }

        return new CollectionInfoLegacyIterator(new ArrayIterator($collections));
    }
1164036
public function search($options = [])
    {
        $query = $this->queryParts;
        if (empty($query)) {
            $query = '{}';
        }
        if (is_array($query)) {
            $query = Json::encode($query);
        }
        $url = [$this->index !== null ? $this->index : '_all'];
        if ($this->type !== null) {
            $url[] = $this->type;
        }
        $url[] = '_search';

        return $this->db->get($url, array_merge($this->options, $options), $query);
    }
1228053
public function  multipileSelect($options = []){
        if (is_string($options)) {
            $options = ['class' => $options];
        }

        if (!Arr::has($options, 'multipile')) {
            Arr::set($options, 'multipile', 'multipile');
        }

        return new Select($this->expression('select'), $options, $this);
    }
619761
def get_countrytag(country):
    """"""
    norm_name = {
        'australia': 'Australia',
        'brazil': 'Brazil',
        'brasil': 'Brazil',
        'canada': 'Canada',
        'european union': 'European Union',
        'eu': 'European Union',
        'e.u.': 'European Union',
        'france': 'France',
        'mexico': 'Mexico',
        'méxico': 'Mexico',
        'méjico': 'Mexico',
        'spain': 'Spain',
        'espana': 'Spain',
        'españa': 'Spain',
        'uk': 'United Kingdom',
        'u.k.': 'United Kingdom',
        'united kingdom': 'United Kingdom',
        'united states of america': 'United States',
        'united states': 'United States',
        'us': 'United States',
        'usa': 'United States',
        'u.s.': 'United States',
        'u.s.a.': 'United States'
    }
    if country is not None and country.lower() in norm_name:
        return REGIONTAGS.get(norm_name.get(country.lower()))
    else:
        raise ValueError(
            'The available regions are {0}.'.format(
                ', '.join('\'{}\''.format(k) for k in REGIONTAGS)))
636383
public function country(array &$submitted, array $options = array())
    {
        $this->options = $options;
        $this->submitted = &$submitted;

        $this->validateCountry();
        $this->validateWeight();
        $this->validateBool('status');
        $this->validateCodeCountry();
        $this->validateName();
        $this->validateNativeNameCountry();
        $this->validateZoneCountry();
        $this->validateFormatCountry();

        $this->unsetSubmitted('update');

        return $this->getResult();
    }
202317
protected function getCountries() {
        if (!$this->_countries) {
            $this->_countries = new CountryList($this->version);
        }

        return $this->_countries;
    }
29384
protected function getResourcePayload(array $options = []) : ?array
    {
        $local  = $this->parseLocalResources($this->resources->get('compiled'));
        $remote = $this->resources->get('styles.remote');

        $sheets = $this->mergeResourceArrays($local, $remote);

        if ($sheets === null) {
            return null;
        }

        ksort($sheets);

        return $sheets;
    }
225810
public function setGlobalOptions($options = null) {
    if(!$options) {
      $css = BASE_PATH . '/themes/' . SSViewer::current_theme() . '/css/pdf.css';
      $header = BASE_PATH . '/mysite/templates/Pdf/header.html';
      $footer = BASE_PATH . '/mysite/templates/Pdf/footer.html';

      $options = array(
        'no-outline',
        'enable-javascript',
        'enable-smart-shrinking',
        'encoding'          => 'UTF-8',
        'dpi'               => 150,
        'image-dpi'         => 150,
        'image-quality'     => 100,
        'user-style-sheet'  => $css,
        'orientation'       => 'Portrait',
        'page-height'       => '297mm',
        'page-width'        => '210mm',
        'page-size'         => 'A4',
        'margin-bottom'     => 30,
        'margin-left'       => 10,
        'margin-right'      => 10,
        'margin-top'        => 30,
        'header-html'       => $header,
        'footer-html'       => $footer,
        'binary'            => '/usr/local/bin/wkhtmltopdf'
      );
    }
    
    $this->globalOptions = $options;
    $this->pdf = new Pdf($this->globalOptions);
  }
9354
public static function select( $items, $options = [] ) {
		$options['tag'] = 'select';
		$options['item'] = function ( $item, $index ) {
			$itemOptions = [];
			if ( is_array( $item ) ) {
				$label = $item['label'];
                $itemOptions['value'] = $item['value'];
				if ( ! empty( $item['options'] ) && ArrayHelper::isAssociative( $item['options'] ) ) {
                    $itemOptions = array_merge( $itemOptions, $item['options'] );
                }
			} else {
				$label = $item;
				$itemOptions['value'] = $item;
			}

			return static::tag('option', $label, $itemOptions );
		};

		return static::ul( $items, $options );
	}
475925
public function getChoices(Options $options)
    {
        /** @var array $tree */
        $tree = $options['tree'];

        $choices = [];

        foreach ($tree as $item) {
            if ($options['current'] && $options['current']->getId() === $item->getId()) {
                continue;
            }

            if (null !== $item->getParent()) {
                continue;
            }

            $choices[sprintf('%s', $item->getName())] = $item->getId();

            $this->childWalker($item, $options, $choices);
        }

        return $choices;
    }
184478
public function getTopRated(array $options = [], array $headers = [])
    {
        return $this->getFactory()->createResultCollection(
            $this->getApi()->getTopRated($options, $headers)
        );
    }
71730
public function get ($options = NULL) {

		// String = view, array = specific fields
		$view = (sizeof($this->fields) === 0) ? $this->view : $this->fields;
		
		return $this->api->read($this->list_name, $this->limit, $this, $view, NULL, $this->options);
	}
640015
public function options($options)
    {
        if (!$options) {
            return $this;
        }

        if (isset($options['limit'])) {
            $this->limit($options['limit'], isset($options['offset']) ? $options['offset'] : 0);
        } elseif (isset($options['size'])) {
            $this->page($options['size'], isset($options['page']) ? $options['page'] : null);
        }

        if (isset($options['distinct'])) {
            $this->distinct($options['distinct']);
        }

        if (isset($options['order'])) {
            $this->orderBy($options['order']);
        }

        if (isset($options['index'])) {
            $this->indexBy($options['index']);
        }

        if (isset($options['with'])) {
            $this->with($options['with']);
        }

        if (isset($options['group'])) {
            $this->groupBy($options['group']);
        }

        return $this;
    }
1025621
public static function select(string $description, $options, $default = null, bool $allowExit = true): string
    {
        return self::choice($description, $options, $default, $allowExit);
    }
1288415
public function getAsHtml($options = [])
    {
        $defaults = [
            'table_id' => null,
            'table_class' => null,
            'translations' => [
                'title' => 'Card',
                'maskedPan' => 'Masked Pan',
                'token' => 'Token'
            ],
        ];

        $options = array_merge($defaults, $options);
        $translations = $options['translations'];

        $html = "<table id='{$options['table_id']}' class='{$options['table_class']}'>";
        $html .= "<tbody><tr><td>" . $translations['maskedPan'] . "</td><td>" . $this->maskedPan . "</td></tr>";
        $html .= "<tr><td>" . $translations['token'] . "</td><td>" . $this->token . "</td></tr></tbody>";
        $html .= "</table>";

        return $html;
    }
802132
public function getPopular(array $options = [], array $headers = [])
    {
        return $this->getFactory()->createResultCollection(
            $this->getApi()->getPopular($options, $headers)
        );
    }