path:framework/base/interfaces.phpoverview:This file contains core interfaces for Yii framework.interface IApplicationComponent:all application compon...
分类:
其他好文 时间:
2014-07-22 22:55:14
阅读次数:
165
###download and config- download yii-1.1.12- unzip into yii-1.1.12- config yii-1.1.12 dir an apache httpdoc dir###check yii requirementshttp://hostnam...
CComponent:path:framework/base/CComponent.phpoverview:This file contains the foundation classes for component-based and event-driven programming. ...
分类:
其他好文 时间:
2014-07-16 16:03:00
阅读次数:
180
一般情况下,yii框架的CActiveForm组建的提示是英文的,把它改成中文提示首先在main.php配置文件中,设置'language'=>'zh_cn';这样将会使得cannot be blank显示为不能为空然后再到相应的模型中添加相应的中文注释,这样,提示都将变成中文提示。
分类:
其他好文 时间:
2014-07-16 15:19:26
阅读次数:
221
array(array(‘username’, ‘required’),array(‘username’, ‘length’, ‘min’=>3, ‘max’=>12),array(‘password’, ‘compare’, ‘compareAttribute’=>’password2′, ‘on...
分类:
其他好文 时间:
2014-07-13 11:57:16
阅读次数:
431
在网上也搜了很多的例子,根据网络上的解释,慢慢摸索,用了将近2周的时间。笨人,没办法。在yii php框架下 无限级分类。通过网络上的,我们都了解到 实现文章 无限级分类,可以使用左右值编码,是通过二叉树的先序遍历 来得到 类别的,不使用递归。这种方法在 全部查询出 类别的时候,是很简单的。先看数据...
分类:
其他好文 时间:
2014-07-11 19:04:37
阅读次数:
213
数组名最好与相应的model所应,比如有个叫BasicWord的model,前端表单中的name属性赋值的格式应类似这样:name="BasicWord[word_id]"虽然有的时候不这样写也正确,但是最好这样写,因为今天在处理文件上传表单的时候,由于数组名与model名不同,导致致命错误。
分类:
其他好文 时间:
2014-07-11 12:34:06
阅读次数:
167
1、开启apache的mod_rewrite模块#去掉LoadModulerewrite_modulemodules/mod_rewrite.so前的“#”符号
#如果是ubuntu系统,系统默认是开启rewrite的
cd/etc/apache2/mods-enabled
#查看是否有rewrite.load链接文件,如果没有则建立链接文件
cd/etc/apache2/mods-enabled
ln-s../..
分类:
Web程序 时间:
2014-07-10 19:17:11
阅读次数:
286
Active Record (AR) 是一个流行的对象-关系映射 (ORM) 技术。 每个 AR 类代表一个数据表(或视图),数据表(或视图)的列在 AR 类中体现为类的属性,一个 AR 实例则表示表中的一行。 常见的 CRUD 操作作为 AR 的方法实现。摘自Yii官网:http://www.yi...
分类:
其他好文 时间:
2014-07-10 16:25:15
阅读次数:
145
当前页面:Yii::app()->request->url;跳转前一个页面:$this->redirect(Yii::app()->request->urlReferrer);根目录URL:Yii::app()->baseUrl 或 Yii::app()->request->baseUrl;自定义U...
分类:
其他好文 时间:
2014-07-09 16:08:45
阅读次数:
188