0
<input id="BreakdownProgName" type="text" required="required" placeholder="customer name" size="50" name="data[Breakdown][prog_name]">
一个输入框,我的模型验证是不是这个代码的工作,但是当我把像如下─
<?php echo $this->Form->input('Breakdown.prog_name',array('label'=>false,'div'=>false,'size'=>50,'placeholder'=>"customer name",'type'=>'text')); ?>
那一次验证工作完全取代上面的代码。但我想使用第一个代码,并且希望验证能够与第一个代码完美匹配。我该怎么做?
我的控制器代码是
public function qty_breakdown1()
{
$this->layout='common';
if(empty($this->data) == false)
{
if($this->Breakdown->save($this->data))
{
//echo "This";
$this->Session->setFlash('B Added Successfully.', 'default', array('class' => 'oMsg1 oMsgError1'));
$this->redirect('qty_breakdown');
}
}
else
{
$this->set('errors', $this->Breakdown->invalidFields());
}
}
你能告诉我你所告诉的代码....... – amit