谁一开始就是大神?

Yii的表单的id怎么设置?[1.1]

<?php $form=$this->beginWidget('CActiveForm', array(
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
)); ?>

<?php 
if(Yii::app()->user->hasFlash('success')){
    echo Yii::app()->user->getFlash('success');
}
?>
<table class="table">
	<tr>
		<td class="th" colspan="10">修改密码</td>
	</tr>
	<tr>
		<td>用户</td>
		<td><?php echo Yii::app()->user->name ?></td>
	</tr>
	<tr>
		<td><?php echo $form->labelEx($userModel, 'password') ?></td>
		<td>
			<?php echo $form->passwordField($userModel, 'password') ?>
			<?php echo $form->error($userModel, 'password') ?>
		</td>
	</tr>
	<tr>
		<td><?php echo $form->labelEx($userModel, 'password1') ?></td>
		<td>
			<?php echo $form->passwordField($userModel, 'password1') ?>
			<?php echo $form->error($userModel, 'password1') ?>
		</td>
	</tr>
	<tr>
		<td><?php echo $form->labelEx($userModel, 'password2') ?></td>
		<td>
			<?php echo $form->passwordField($userModel, 'password2') ?>
			<?php echo $form->error($userModel, 'password2') ?> 
		</td>
	</tr>
	<tr>
		<td colspan="10">
			<input type="submit" class="input_button" value="修改" />
		</td>
	</tr>
</table>
<?php $this->endWidget() ?>

里面的form的id是怎么设置呢?如果多个form怎么区分呢?

$form->labelEx($userModel, 'password2',array('id'=>'xxx'))形式设置id,多个form同理。

赞(0) 打赏
未经允许不得转载:菜鸟之家 » Yii的表单的id怎么设置?[1.1]

评论 抢沙发

登录

找回密码

注册