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="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="1" type="radio" name="Project[update_time]"> <label for="Project_update_time_0">分页</label><br>
<input id="Project_update_time_1" value="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="创建">
yii模板中的checkBox标签
<?php echo $form->checkBox($model, 'update_time',array('checked'=>'checked')); ?>
编译后:
<input id="ytProject_update_time" type="hidden" value="0" name="Project[update_time]">
<input checked="checked" name="Project[update_time]" id="Project_update_time" value="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="1">分页</option>
<option value="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="1">分页</option>
<option value="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="1" type="checkbox" name="Project[update_time][]"> <label for="Project_update_time_0">分页</label><br>
<input id="Project_update_time_1" value="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标签的更多相关文章

  1. s:form标签

    2017-01-07 17:43:18 基本的用法 <!-- Action类必须有一个无参的构造器,因为在执行action方法之前,拦截器已经创建了一个"空"的Action对 ...

  2. 修改 jquery.validate.js 支持非form标签

    尝试使用markdown来写一篇blog,啦啦啦 源代码传送门:github 在特殊情况下我们使用jquery.validate.js对用户输入的内容做验证的时候,表单并不是一定包含在form之中,有 ...

  3. springmvc的form标签

    1.要使用Spring MVC提供的表单标签,首先需要在视图页面添加: <%@ taglib prefix="form" uri="http://www.sprin ...

  4. 上传图片HTML <form> 标签的 method 属性

    <!DOCTYPE HTML><html><body> <form action="/example/html5/demo_form.asp&quo ...

  5. 关于form标签,你该知道

    有没有发现,自己在写模板的时候很少使用form元素,一来form和table总是那么傻傻分不清楚:二来form的特性理解不清楚,有了input.label来了直接就上,根本不用form(不知道有没有人 ...

  6. 解决HtmlAgilityPack无法获取form标签子节点的问题

    问题描述 今天使用HtmlAgilityPack提取Form表单下的input节点,发现提取的form节点没有子节点,InnerHtml也是为空,起初以为是标签不全导致,后来分析html代码发现不可能 ...

  7. SPRING IN ACTION 第4版笔记-第六章RENDERING WEB VIEWS-002- Spring的JSP标签之form标签(<sf:input><sf:errors><sf:form>)

    一. Spring offers two JSP tag libraries to help define the view of your Spring MVC web views. One tag ...

  8. HTML <form> 标签的 enctype 属性

    HTML <form> 标签 定义和用法 enctype 属性规定在发送到服务器之前应该如何对表单数据进行编码. 默认地,表单数据会编码为 "application/x-www- ...

  9. Form标签+Css基础

      一.Form表单标签 <form action="" method=""></form>    表单就是用来将用户的信息提交到服务器 ...

  10. HTML <form> 标签的 method 属性(20161028)

    HTML <form> 标签的 method 属性 HTML <form> 标签 实例 在下面的例子中,表单数据将通过 method 属性附加到 URL 上: <form ...

随机推荐

  1. 《DSP using MATLAB》示例Example7.6 Type-3 Linear-Phase FIR

    代码: h = [-4, 1, -1, -2, 5, 0, -5, 2, 1, -1, 4]; M = length(h); n = 0:M-1; [Hr, w, c, L] = Hr_Type3(h ...

  2. 接口测试框架——第四篇-url、excel内容等

    到现在为止,发送邮件(email_module).读excel(excel_module).发送requests(requests_module).常量(setting)我们都已经完成了,看看第一篇中 ...

  3. 接口测试基础——第6篇unittest模块(二)

    通过上次的运行,大家应该已经发现了,就是我们写了三个用例,那么在测试报告中setUp和tearDown方法分别运行了三次.没错,这也就是说,每次运行用例之前都会运行setUp和tearDown方法.今 ...

  4. 理想中的 PCB 文件格式

    理想中的 PCB 文件格式 因为平时写代码使用 git,在画 PCB 也使用 git 来管理 PCB 文件. 但是 PCB 文件是二进制的,所以在比较时非常麻烦. 虽然 PCB 文件可以导出 文本文件 ...

  5. python绘图踩的坑

    踩的坑 pyecharts安装地图包 pip install echarts-countries-pypkg 报错Unknown or unsupported command 'install' 这可 ...

  6. BZOJ3261:最大异或和

    浅谈\(Trie\):https://www.cnblogs.com/AKMer/p/10444829.html 题目传送门:https://lydsy.com/JudgeOnline/problem ...

  7. java指定文件编码格式

    在创建文件并打印字符串时,如果不指定编码,默认是按系统的编码格式来.比如我们的linux环境中编码如下: CMREAD-SV43 /home/wlf> locale LANG=en_US.UTF ...

  8. linux(centos)下安装ffmpeg

    [备忘]windows环境下20行php代码搞定音频裁剪 上次我的这篇文章将了windows下web中如何操作ffmpeg的文章,这里则记录下linux(centos)下的安装 首先:我花了中午大概1 ...

  9. 一段四表联查外加字符拼接的sql,留存备查

    select DISTINCT [P_ID],[P_CODE],[P_CODE_OLD],[P_NAME],[NATIVE_PLACE],[GENDER],[EDUCATION],[EMPLOY_DA ...

  10. 打包python文件,让文件程序化

    通过对源文件打包,Python程序可以在没有安装 Python的环境中运行,也可以作为一个独立文件方便传递和管理. 现在网上主流的打包方式有两种py2exe或者pyinstaller两款多平台的Pyt ...