Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要 Cakephp 使用创建输入字段,$this->Form->input()并在此字段参数中添加 Html 属性 - required="required"。
$this->Form->input()
required="required"
我怎样才能做到这一点?
只需按照文档进行即可。第二个参数采用所有选项(html 和其他):
$this->Form->input('field_name', array('required'=>true));