小编Ime*_*ime的帖子

yii中验证规则的场景

我在游荡是否有机会使用场景规则,

在我的模型中我有

public function rules()
{
    return array(
        array('delivery, firstNameBilling, lastNameBilling, addressBilling, cityBilling, countryBilling,
            postBilling, telephoneBilling, mailBilling, firstNameDelivery, lastNameDelivery, addressDelivery,
            cityDelivery, countryDelivery, postDelivery, telephoneDelivery, mailDelivery', 'required'),
        array('active', 'numerical', 'integerOnly'=>true),
    );
}
Run Code Online (Sandbox Code Playgroud)

在我看来,我有类似的东西

    <tr>
        <td>
            <p><?php echo $form->label($model,'telephoneBilling'); ?><span>:&nbsp;</span><span class="required">*</span></p>
        </td>
        <td>
            <?php echo $form->textField($model,'telephoneBilling'); ?>
            <?php echo $form->error($model,'telephoneBilling'); ?>
        </td>
    </tr>
</table>

<p><?php echo $form->checkBox($model,'active', array('class' => 'change')); ?>
    Delivery information: Please check the box if your delivery address differs from your billing address and enter the
    required delivery address …
Run Code Online (Sandbox Code Playgroud)

php validation scenarios yii yii-validation

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

php ×1

scenarios ×1

validation ×1

yii ×1

yii-validation ×1