首页 > 代码库 > php-yii-form标签
php-yii-form标签
yii 标签用法(模板)
(2013-08-14 17:28:19)转载▼
标签: it | 分类: yii |
yii模板中的label标签
<?php echo $form->labelEx($model,‘name‘); ?>
编译后:
<label for="Project_name" class="required">项目名称 <span class="required">*</span></label>
yii模板中的文本标签
<?php echo $form->textField($model,‘name‘,array(‘size‘=>60,‘maxlength‘=>128)); ?>编译后:
<input size="60" maxlength="128" name="Project[name]" id="Project_name" type="text">
yii模板中的error标签
<?php echo $form->error($model,‘name‘); ?>
编译后:
<div class="errorMessage">{变量}</div>
yii模板中的textarea标签
<?php echo $form->textArea($model,‘description‘,array(‘rows‘=>6, ‘cols‘=>50)); ?>
编译后:
<textarea rows="6" cols="50" name="Project[description]" id="Project_description" class="error"></textarea>
yii模板中的hidden标签
<?php echo $form->hiddenField($model,‘create_time‘,array(‘value‘=>time())); ?>
编译后:
<input value="http://www.mamicode.com/1376475100" name="Project[create_time]" id="Project_create_time" type="hidden">
yii模板中的password标签
<?php echo $form->passwordField($model,‘password‘); ?>
编译后:
<input name="Project[password]" id="Project_password" type="password">
yii模板中的url标签
<?php echo $form->urlField($model,‘url‘); ?>
编译后:
<input name="Project[url]" id="Project_url" type="url">
yii模板中的radio标签
<?php echo $form->radioButtonList($model, ‘update_time‘, array(‘1‘=>‘分页‘,‘0‘=>‘不分页‘)); ?>
编译后:
<input id="ytProject_update_time" type="hidden" value="" name="Project[update_time]">
<span id="Project_update_time"><input id="Project_update_time_0" value="http://www.mamicode.com/1" type="radio" name="Project[update_time]"> <label for="Project_update_time_0">分页</label><br>
<input id="Project_update_time_1" value="http://www.mamicode.com/0" type="radio" name="Project[update_time]">
<label for="Project_update_time_1">不分页</label></span>
yii模板中的file标签
<?php echo $form->fileField($model, ‘update_time‘); ?>
编译后:
<input id="ytProject_update_time" type="hidden" value="" name="Project[update_time]">
<input name="Project[update_time]" id="Project_update_time" type="file">
yii模板中的button标签
<?php echo CHtml::submitButton($model->isNewRecord ? ‘创建‘ : ‘保存‘); ?>
编译后:
<input type="submit" name="yt0" value="http://www.mamicode.com/创建">
yii模板中的checkBox标签
<?php echo $form->checkBox($model, ‘update_time‘,array(‘checked‘=>‘checked‘)); ?>
编译后:
<input id="ytProject_update_time" type="hidden" value="http://www.mamicode.com/0" name="Project[update_time]">
<input checked="checked" name="Project[update_time]" id="Project_update_time" value="http://www.mamicode.com/1" type="checkbox">
yii模板中的select标签
<?php echo $form->dropDownList($model, ‘update_time‘, array(‘1‘=>‘分页‘,‘0‘=>‘不分页‘)); ?>
编译后:
<select name="Project[update_time]" id="Project_update_time">
<option value="http://www.mamicode.com/1">分页</option>
<option value="http://www.mamicode.com/0">不分页</option>
</select>
yii模板中的select标签
<?php echo $form->listBox($model, ‘update_time‘, array(‘1‘=>‘分页‘,‘0‘=>‘不分页‘)); ?>
编译后:
<select size="4" name="Project[update_time]" id="Project_update_time">
<option value="http://www.mamicode.com/1">分页</option>
<option value="http://www.mamicode.com/0">不分页</option>
</select>
yii模板中的checkbox标签
<?php echo $form->checkBoxList($model, ‘update_time‘, array(‘1‘=>‘分页‘,‘0‘=>‘不分页‘)); ?>
编译后:
<input id="ytProject_update_time" type="hidden" value="" name="Project[update_time]"><span id="Project_update_time"><input id="Project_update_time_0" value="http://www.mamicode.com/1" type="checkbox" name="Project[update_time][]"> <label for="Project_update_time_0">分页</label><br>
<input id="Project_update_time_1" value="http://www.mamicode.com/0" type="checkbox" name="Project[update_time][]"> <label for="Project_update_time_1">不分页</label></span>
yii模板中的date标签
<?php echo $form->dateField($model, ‘update_time‘); ?>
编译后:
<input name="Project[update_time]" id="Project_update_time" type="date">
yii模板中的number标签
<?php echo $form->numberField($model, ‘number‘); ?>
编译后:
<input name="Project[number]" id="Project_number" type="number">
yii模板中的email标签
<?php echo $form->emailField($model, ‘email‘); ?>
编译后:
<input name="Project[email]" id="Project_email" type="email">
yii模板中的label标签
<?php echo $form->label($model, ‘update_time‘); ?>
编译后:
<label for="Project_update_time">更新时间</label>
php-yii-form标签
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。