CakePhp 1.1을 1.2 이상으로 업그레이드하고 있습니다 ... 마침내.
양식 유효성 검사에 문제가 있습니다. 설명서에서 $ html-> tagErrorMsg가 사용되지 않으며 $ form-> error로 변경해야한다는 것을 알았습니다.
모든 위치에서이 작업을 수행했지만 오류는 표시되지 않습니다. 그들은 내 1.1 버전에서 잘 작동합니다.
<div class="column span-5">
<?php echo $html->input('Account/firstname', array('size' => 20, 'class'=>'span-4 first last txt')); ?>
</div>
<div class="column span-3 last"><span class="my_error"><?php echo $html->tagErrorMsg('Account/firstname', 'Please enter a first name.');?></span></div>
</div>
.ctp 지금 IS : 모델에
<div class="column span-5">
<?php echo $form->input('Account/firstname', array('size' => 20, 'class'=>'span-4 first last txt')); ?>
</div>
<div class="column span-3 last"><span class="my_error"><?php echo $form->error('Account/firstname', 'Please enter a first name.');?></span></div>
</div>
(account.php) : 여기
는 BE하는 데 사용되는 .ctp의 코드
.ctp의 내가 바꿨다 :
var $validate = array(
'firstname' => VALID_NOT_EMPTY,
);
:
var $validate = array(
'firstname' => 'notEmpty',
);
내가 뭘 잘못입니까? 1.2 이상에서 올바른 양식 유효성 검증의 예를 포함 시키시겠습니까?