Carbon_Fields\Field\Select_Field::template PHP Method

template() public method

The main Underscore template of this field.
public template ( )
    public function template()
    {
        ?>
		<# if (_.isEmpty(options)) { #>
			<em><?php 
        _e('no options', 'carbon-fields');
        ?>
</em>
		<# } else { #>
			<select id="{{{ id }}}" name="{{{ name }}}">
				<# _.each(options, function(option) { #>
					<option value="{{ option.value }}" {{{ option.value == value ? 'selected="selected"' : '' }}}>
						{{{ option.name }}}
					</option>
				<# }) #>
			</select>
		<# } #>
		<?php 
    }