я иметь следующий вид:CakePHP валидация не работает
<?php echo $this->Html->image('itemdefault.gif',array('class'=>'image1')); ?>
<?php echo $this->form->input('quantity',array('class'=>'input')); ?><br>
<?php echo $this->form->input('SpecialInstructions', array('type'=>'select','style'=>'font-size:13pt;width:120px;','options'=>$spec_ins)); ?><br>
<?php echo $this->form->input('Ingredients',array('class'=>'input')); ?><br>
<?php echo $this->form->end('Save',array('class'=>'button1'));
и это подтверждение в модели:
var $validate=array
(
'quantity'=>array
(
'numeric'=>array('rule'=>'numeric','required'=>true,'message'=>'Enter numbers only'),
'qty_must_not_be_blank'=>array('rule'=>'notEmpty','message'=>'Quantity cannot be left blank')
),
'Ingredients'=>array
(
'body_must-not_be_blank'=>array('rule'=>'notEmpty','message'=>'Body must not be blank')
)
);
, но ни один из проверки не работает. это потому, что в моей базе данных полей нет?
Как вы знаете, что проверка не работает? Как вы протестировали? –
Поместите более подробную информацию в свой вопрос для уточнения – Anubhav