如果我想用cakephp 2.x更改formhelper中所有元素的标记和样式
示例
$这 - >形状配合>输入( “名称”) 生成:
<div class="input number">
<label for="AfiliadoCedula">Cedula</label>
<input name="data[Afiliado][cedula]" type="number" value="12" id="AfiliadoCedula">
<div class="error-message">name error</div>
</div>
更改为:
<div class="input number **myclassfieldset**">
<label for="AfiliadoCedula" class="**myclasslabel**">Cedula</label>
<input name="data[Afiliado][cedula]" type="number" class="**myclassinput**" value="12" id="AfiliadoCedula">
<**label** class="error-message **myclasserror**">name error</**label**>
</div>
非常感谢你的帮助!!
答案 0 :(得分:4)
$this->Form->input("name", array(
'div' => array('class' => '**myclassfieldset**'),
'label' => array('class' => '**myclasslabel**'),
'class' => '**myclassinput**'
));