1
내 양식에 CMaskedTextField가 있는데,이를 채울 때 $ _POST []에서 값을 반환하지 않습니다! 당신이 당신이 model
다음 name
를 제거하고 attribute
를 추가해야 사용하려면, 위젯에서Chtml Cmaskedtextfield가 값을 보내지 않습니까?
<?php echo CHtml::label(Yii::t('models', 'form.label.position'), 'position'); ?>
<?php
$this->widget('CMaskedTextField', array(
'name' => "position",
'mask' => '999',
'htmlOptions' => array(
'size' => 5,
'placeholder' => Yii::t('models', 'form.hint.position'),
'title' => Yii::t('models', 'form.hint.position'),
),
));
?>
:
<?php echo CHtml::label(Yii::t('models', 'form.label.position'), 'position'); ?>
<?php
$this->widget('CMaskedTextField', array(
'model' => null,
'name' => "position",
'mask' => '999',
'htmlOptions' => array(
'size' => 5,
'placeholder' => Yii::t('models', 'form.hint.position'),
'title' => Yii::t('models', 'form.hint.position'),
),
));
?>
고맙습니다.하지만 답이 맞지 않아, 모델에 'model'=> null'이 (가) 있지만 $ _POST [ 'position']이 (가) 비어 있다고 말한대로 모델이 없습니다 .... – shgnInc
@ Shgn.ir : 대답을 업데이트했습니다. 좀 봐주세요! – secretlm
그래, 내가 다른 필드가 올바르게 전송되기 때문에 양식의 방법에 대해서는 정말 확신합니다. 'post ', array ('id '=>'form-id ',))'echo CHtml :: beginForm ($ this-> createUrl ('create ', array ('form '=> $ form_id) – shgnInc