在视图中:
echo $this->Form->input('Ingredient');
上面填充了 HTML 输出为的多选列表:
<select name="data[Ingredient][Ingredient][]" option="hh" multiple="multiple" id="IngredientIngredient">
<option value="1" selected="selected">Tomato</option>
<option value="2">Spaghetti </option>
<option value="3" selected="selected">Salt</option>
</select>
我需要知道的是如何为生成的<option>
标签添加属性?