开发者

Is it possible to force the form helper to render a field as required even if it isn't in CakePHP?

开发者 https://www.devze.com 2023-04-01 05:34 出处:网络
Is there some parameter or workaround I can use to have the form helper render a field as if it were required by the model even if the model does not actually require it?

Is there some parameter or workaround I can use to have the form helper render a field as if it were required by the model even if the model does not actually require it?

(I'm looking for 开发者_C百科the cakephp required rendering type, not the actual 'required' form property making this a different question than Cakephp Form Helper)


All the "required" style is is a specific CSS class you can set yourself:

$this->Form->input('foo', array('div' => array('class' => 'input text required')));
0

精彩评论

暂无评论...
验证码 换一张
取 消