首页 > 活着 > YII view 常用extensions

YII view 常用extensions

带menu的面包屑exbreadcrumbs支持自定义css。http://www.yiiframework.com/extension/exbreadcrumbs

CGridView总计插件 http://www.yiiframework.com/extension/gridcolumns/

带导出的gridview,支持PDF/EXCEL/Excel2007/CSV/HTML http://www.yiiframework.com/extension/tlbexcelview

YORM是一款Yii的第三方ORM插件 分表分库

textArea

Java代码
1.textArea($model,’describe’,array(‘cols’=>40,’rows’=>4)); ?>
textArea($model,’describe’,array(‘cols’=>40,’rows’=>4)); ?>checkbox

Java代码
1.
斜杠是从views目录开始写的

Java代码
1.$this->render( “/site/flash_message”); //完整路径 view/site/flash_message.php
$this->render( “/site/flash_message”); //完整路径 view/site/flash_message.php 当 使用 render()时,布局被隐式应用.视图脚本 protected/views/layouts/main.php是默认的布局文件 .

Java代码
1.public $layout=’//layouts/column2′;
public $layout=’//layouts/column2′;进行自定义。要渲染一个不带布局的视图,则需调用 renderPartial() 。

在view中调用layout

Java代码
1.beginContent(‘application.views.layouts.main’); ?>
2.html between
3.endContent(); ?>
beginContent(‘application.views.layouts.main’); ?>
html between
endContent(); ?> 下拉框

Java代码
1.CHtml::dropDownList(‘city_id’,”, array(1=>’User’, 2=>’Admin’));
2.array(‘1’=>array(‘selected’=>true))); ?>
3.dropDownList($model, ‘type’, array(1=>’User’, 2=>’Admin’),array(‘prompt’ =>’-请选择-‘)); ?>
CHtml::dropDownList(‘city_id’,”, array(1=>’User’, 2=>’Admin’));
array(‘1’=>array(‘selected’=>true))); ?>
dropDownList($model, ‘type’, array(1=>’User’, 2=>’Admin’),array(‘prompt’ =>’-请选择-‘)); ?>Form表单标签

Java代码
1.createUrl($this->route));?>
2.
3.beginWidget(‘CActiveForm’, array(
4. ‘action’=>’index.php?r=site/update’,
5. ‘enableAjaxValidation’=>false,
6.)); ?>
7.endWidget(); ?>
createUrl($this->route));?>

beginWidget(‘CActiveForm’, array(
‘action’=>’index.php?r=site/update’,
‘enableAjaxValidation’=>false,
)); ?>
endWidget(); ?>普通form注意加hidden r否则get得不到r=controllerid/actionid

Java代码
1.

submit按钮

Java代码
1.isNewRecord ? ‘Create’ : ‘Save’); ?>
isNewRecord ? ‘Create’ : ‘Save’); ?>radios

Java代码
1.radioButtonList($model,’gift’,array(‘1’=>’是’,’0’=>’否’),array(‘separator’=>”)); ?>
radioButtonList($model,’gift’,array(‘1’=>’是’,’0’=>’否’),array(‘separator’=>”)); ?>链接

Java代码
1.$data->Id)); ?>
$data->Id)); ?> 导航菜单

Java代码
1.widget(‘zii.widgets.CMenu’,array(
2.’items’=>array(
3.array(‘label’ => ‘Delete Issue’, ‘url’ => ‘#’, ‘linkOptions’ => array(‘submit’ => array(‘delete’, ‘id’ => $model->id), ‘confirm’ => ‘Are you sure you want to delete this item?’)),
4. array(‘label’=>’商品list’, ‘url’=>array(‘commodity/’)), //r=commodity
5. array(‘label’=>’About’, ‘url’=>array(‘site/page’, ‘view’=>’about’)), //r=site/page?view=about
6. array(‘label’=>’Logout (‘.Yii::app()->user->name.’)’, ‘url’=>array(‘site/logout’), ‘visible’=>!Yii::app()->user->isGuest)
7.),
8.));
9.?>

带menu的面包屑exbreadcrumbs支持自定义css。http://www.yiiframework. […]

  1. 还没有评论
评论提交中, 请稍候...

留言

(Spamcheck Enabled)

Trackbacks & Pingbacks ( 0 )
  1. 还没有 trackbacks