简体   繁体   English

如果我使用$ this-> Form-> textarea(),则验证无法在蛋糕php中工作

[英]validation not working in cake php if i use $this->Form->textarea()

validation work i use ($this->Form->input) 我使用的验证工作($ this-> Form-> input)

<?php echo $this->Form->input('Car', array('type'=>'textarea','label'=>false, 'cols'=>'23', 'rows'=>'4'));?>

and if i use ($this->Form->textarea) validation not work 如果我使用($ this-> Form-> textarea)验证不起作用

<?php echo $this->Form->textarea('Car', array('label'=>false, 'cols'=>'23', 'rows'=>'4'));?>

but output is same both line of code 但是输出是相同的两行代码

could anyone tell me why it's happening ... 谁能告诉我为什么会这样...

Validation is still working. 验证仍在进行。 What is not working is the display of the error . 错误显示不起作用。

FormHelper::input does a lot of work, including output of validation errors. FormHelper::input做很多工作,包括输出验证错误。
FormHelper::textarea only outputs a textarea, nothing more. FormHelper::textarea仅输出一个textarea,仅此而已。 You have to output the error yourself using echo $this->Form->error('Car') . 您必须使用echo $this->Form->error('Car')自己输出错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM