我正在尝试使用Cakephp创建一个单选按钮,就像结果应该类似的那样
<div data-attr="radio" id="1">
<label id="label1">Untitled1</label><br/>
<input type="radio" value="option1" id="Radio11" name="Workexperience"/>
<label for="Radio11">Option1</label>
<input type="radio" value="option2" id="Radio12" name="Workexperience"/>
<label for="Radio12">Option2</label>
</div>
Run Code Online (Sandbox Code Playgroud)
如何使用Form helper生成如此..请建议我..
Ana*_*hah 12
这可能有所帮助,
对于无线电类型输入,"分隔符"属性可用于注入标记以分隔每个输入/标签对.
代码视图
<?php echo $form->input('field', array(
'before' => '--before--',
'after' => '--after--',
'between' => '--between---',
'separator' => '--separator--',
'options' => array('1', '2'),
'type' => 'radio'
));?>
Run Code Online (Sandbox Code Playgroud)
输出:
<div class="input">
--before--
<input name="data[User][field]" type="radio" value="1" id="UserField1" />
<label for="UserField1">1</label>
--separator--
<input name="data[User][field]" type="radio" value="2" id="UserField2" />
<label for="UserField2">2</label>
--between---
--after--
</div>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
17261 次 |
| 最近记录: |