Carbon_Fields\Field\Set_Field::template PHP Method

template() public method

The Underscore template of this field.
public template ( )
    public function template()
    {
        ?>
		<# if (_.isEmpty(options)) { #>
			<em><?php 
        _e('no options', 'carbon-fields');
        ?>
</em>
		<# } else { #>
			<div class="carbon-set-list">
				<# _.each(options, function(option, i) { #>
					<# 
						var selected = jQuery.inArray(String(option.value), value) > -1;
						var counter = i + 1;
						var exceed = limit_options > 0 && counter > limit_options;
						var last = options.length === counter;
					#>

					<p {{{ exceed ? 'style="display:none"' : '' }}}>
						<label>
							<input type="checkbox" name="{{{ name }}}[]" value="{{ option.value }}" {{{ selected ? 'checked="checked"' : '' }}} />
							{{{ option.name }}}
						</label>
					</p>

					<# if (!exceed && !last && counter == limit_options) { #>
						<p>... <a href="#" class="carbon-set-showall"><?php 
        _e('Show All Options', 'carbon-fields');
        ?>
</a></p>
					<# } #>
				<# }) #>
			</div>
		<# } #>
		<?php 
    }