上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 22 下一页

2013年12月8日

yii CListView中使用CArrayDataProvider自定义数组作为数据

摘要: CArrayDataProvider类手册:http://www.yiichina.com/api/CArrayDataProvider在yii中无论是CListView还是CGridView,对应数据的传值都是从后台完成的,有时候我们不是从数据库读取,而是自定义一些数组来作为表格的数据。其实Yii在后台对应数组处理有2个好函数的,一个是CActiveDataProvider,另外一个是CArrayDataProvider。从英文的字面意思很容易理解,CActiveDataProvider是用来给从数据库读取的那些数据然后转换成数组;CArrayDataProvider是把自定义的数组转换为可 阅读全文

posted @ 2013-12-08 17:18 imxiu 阅读(916) 评论(0) 推荐(0) 编辑

YII安装smarty-view-renderer扩展

摘要: smarty-view-rendererhttp://www.yiiframework.com/extension/smarty-view-renderer/相关下载及介绍:https://github.com/yiiext/smarty-rendererhttp://www.startfeel.com/daily/using_smarty_in_yii.htmlhttp://blog.163.com/ydmx_lei/blog/static/77053405201252021057209/******************安装使用说明******************1. 将压缩包解压内 阅读全文

posted @ 2013-12-08 15:49 imxiu 阅读(534) 评论(0) 推荐(0) 编辑

Yii中用递归方法实现无限级分类

摘要: 用递归方法实现多级分类,适合分级不太多的分类,如三到四级。数据库结构:Model中(Category.php) /** * 获取全部分类信息 */ public function getAllcategory() { $sql = 'select * from '.$this->tableName().' order by id asc'; $category = ZDBTool::QueryAll($sql); return $category; } Controller中(Ca... 阅读全文

posted @ 2013-12-08 15:30 imxiu 阅读(3190) 评论(1) 推荐(1) 编辑

2013年12月1日

Yii中Ajax的使用,如收藏功能

摘要: view中clientScript;$cs->registerScriptFile('http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js');?>user->hasFlash('success')){ ?> user->getFlash('success'); ?>user->hasFlash('failed')){ ?> user->getFlash('failed'); ? 阅读全文

posted @ 2013-12-01 23:58 imxiu 阅读(592) 评论(0) 推荐(0) 编辑

Javascript and AJAX with Yii(在yii 中使用 javascript 和ajax)

摘要: 英文原文:http://www.yiiframework.com/wiki/394/javascript-and-ajax-with-yii/***http://www.yiiframework.com/wiki/394/javascript-and-ajax-with-yiiJavascript and AJAX with Yii translated by php工程师http://blog.csdn.net/phpgcs 1. Official JS wrappers 1.1 Form validation 1.2 CGridView 1.3 CJui* classe... 阅读全文

posted @ 2013-12-01 22:38 imxiu 阅读(733) 评论(0) 推荐(0) 编辑

Yii框架zii.widgets.grid自定义按钮,ajax触发事件并提示

摘要: 相关类手册:http://www.yiichina.com/api/CButtonColumnbuttons属性public array$buttons;the configuration for additional buttons. Each array element specifies a single button which has the following format:'buttonID' => array( 'label'=>'...', // text label of the button 'url&# 阅读全文

posted @ 2013-12-01 19:15 imxiu 阅读(819) 评论(0) 推荐(0) 编辑

yii 中设置提示成功信息,错误提示信息,警告信息

摘要: 方法一:user->setFlash(‘success’,”Data saved!”); 设置键值名为success的临时信息.在getFlash后删除. 可以定义多种不同的键值名对象的消息.?>user->hasFlash(‘success’)):?> 消息存在里,user->getFlash(‘success’); ?> 输出消息内容,输出后,就不存在了.clientScript->registerScript(‘myHideEffect’,‘$(“.info”).animate({opacity: 1.0}, 3000).fadeOut(“slo 阅读全文

posted @ 2013-12-01 15:33 imxiu 阅读(1357) 评论(0) 推荐(0) 编辑

2013年11月30日

Yii Framework 开发教程Zii组件-Tabs示例

摘要: 有关Yii Tab类:http://www.yiichina.com/api/CTabViewhttp://www.yiichina.com/api/CJuiTabshttp://blog.csdn.net/dreamzml/article/details/8485446http://www.yiiframework.com/wiki/569/how-to-create-cjui-tabs-render-partial-ajax-tabs-color-tabs/Yii Framework 开发教程Zii组件-Tabs示例基本用法如下:[php] widget('zii.widgets. 阅读全文

posted @ 2013-11-30 23:37 imxiu 阅读(496) 评论(0) 推荐(0) 编辑

Yii 生成表单下拉选框及查询下拉选框

摘要: CHtml类参考:http://www.yiichina.com/api/CHtml#activeDropDownList-detailactiveDropDownList() 方法 public static string activeDropDownList(CModel $model, string $attribute, array $data, array $htmlOptions=array ( ))$modelCModel数据模型$attributestring属性$dataarray生成列表选项的数据(值=>显示) 你可以使用listData来生成这个数据。请参阅list 阅读全文

posted @ 2013-11-30 22:39 imxiu 阅读(1193) 评论(0) 推荐(0) 编辑

Yii框架常见问题汇总

摘要: 然用过Yii做了一个小项目了,但是过程中间解决的问题没有随手记下来,导致新项目开始后,以前碰到的问题还得在查一遍,干脆就记下来,以便不时之需。有新的会随时更新。1.如何显示ActiveRecord执行的sql语句:array( 'class'=>'CFileLogRoute', 'levels'=>'trace,error, warning',),// uncomment the following to show log messages on web pages/*array( 'class'=&g 阅读全文

posted @ 2013-11-30 21:25 imxiu 阅读(538) 评论(0) 推荐(0) 编辑

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 22 下一页

导航