Pressbooks\Options::renderCustomSelect PHP Метод

renderCustomSelect() защищенный Метод

Render a custom select element.
protected renderCustomSelect ( string $id, string $name, string $value = '', string $args, boolean $multiple = false )
$id string
$name string
$value string
$args string
$multiple boolean
    protected function renderCustomSelect($id, $name, $value = '', $args, $multiple = false)
    {
        $is_custom = false;
        if (!array_key_exists($value, $args)) {
            $is_custom = true;
        }
        ?>
		<select name='<?php 
        echo $name;
        ?>
' id='<?php 
        echo $id;
        ?>
'>
		<?php 
        foreach ($args as $key => $label) {
            ?>
			<option value='<?php 
            echo $key;
            ?>
' <?php 
            if ('' == $key && $is_custom) {
                echo 'selected';
            } else {
                selected($key, $value);
            }
            ?>
><?php 
            echo $label;
            ?>
</option>
		<?php 
        }
        ?>
		</select><br />
	<?php 
    }