1
有沒有什麼辦法讓FormHelper在輸入標記中爲模型中定義的規則生成HTML5驗證屬性?HTML5從CakePHP模型驗證中驗證規則
例如
模型var $validate = array(
'title' => array(
'message' => 'This field cannot be left blank',
'required' => true
)
);
鑑於
HTML瀏覽器
echo $this->Form->input('title');
<input type="text" title="This field cannot be left blank" required />
我正在考慮擴展FormHelper並實現此功能。 Tnx的建議! – theZiki