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