<case value="selects">
    <!--
        如果选项的值是自定义数组(必须定义key为title的元素)需要解析，如果选项的值是常规字符串直接显示
        此处主要是用来给option定义更多的属性，比如data-ia=1，那么option应为
        $option = array('title' => 标题, 'data-id' => 1);
    -->
    <div class="form-group item_{$[type]form.name} {$[type]form.extra.class|default=''}">
        <label class="left control-label">
            <?php if($[type]form['extra']['must']): ?>
                <span style="color: red;">*</span>
            <?php endif; ?>
            <span>{$[type]form.title}：</span>
        </label>
        <div class="right">
            <select multiple="multiple" size="6" name="{$[type]form.name}[]" class="form-control lyui-select select" {$[type]form.extra.attr|default=''}>
                <?php $[type]form['value'] = explode(',', $[type]form['value']); dump($[type]form['value']); ?>
                <option value=''>请选择：</option>
                <foreach name="[type]form.options" item="option" key="option_key">
                    <php>if(is_array($option)):</php>
                        <option value="{$option_key}" <in name="[type]form.value" value="$option_key"> selected</in>
                            <foreach name="option" item="option2" key="option_key2">
                                {$option_key2}="{$option2}"
                            </foreach>>
                            {$option.title}
                        </option>
                    <php>else:</php>
                        <option value="{$option_key}" <?php if(in_array($option_key, $[type]form['value'])) { echo 'selected'; } ?>>{$option}</option>
                    <php>endif;</php>
                </foreach>
            </select>
            <notempty name="[type]form.tip">
                <div>
                    <span class="check-tips text-muted small">{$[type]form.tip|default=''}</span>
                </div>
            </notempty>
        </div>
    </div>
</case>
