原创 yii 中CHttpSession的使用

開啓一個session代碼如下: $session=new CHttpSession; $session->open(); $value=$session['name']; // 獲取 session 變量 $session['

原创 yii 1.1.*中按鈕組件CJuiButton的使用

使用這個部件當做一個提交按鈕,你可以在視圖中插入以下代碼: <pre name="code" class="php">$this->widget('zii.widgets.jui.CJuiButton',array(

原创 yii中的用戶授權修改

轉載自:http://duchengjiu.iteye.com/blog/1815496 數據庫 首先在 user 表創建一個新的字段(integer 類型),字段名 'accessLevel',它定義了用戶的訪問權限 擴展

原创 Mysql index的使用

FROM:http://blog.csdn.net/tianmo2010/article/details/7930482 ①MySQL Index 一、SHOW INDEX會返回以下字段 1、Table 表的名稱。 2、 Non

原创 yii 1.1.*中用戶驗證接口IUserIdentity的使用

IUserIdentity接口是由一個用戶驗證類實現的。 包括的公共方法有: authenticate()  驗證用戶身份; getId() 返回一個值,該值代表唯一的身份; 個體IsAuthenticated() 返回一個值,該值表示是

原创 yii中yii-bootstrap的使用

轉載自:http://duchengjiu.iteye.com/blog/1797850 Bootstrap是Twitter推出的一個開源的用於前端開發的工具包。它由Twitter的設計師Mark Otto和Jacob Thorn

原创 Yii 中的數據庫操作

查詢數據集合 1、$admin=Admin::model()->findAll($condition,$params); 這個方法根據一個條件查詢一個集合,如:  findAll("username=:name",array(":na

原创 正則表達式

匹配中文字符的正則表達式: [u4e00-u9fa5]  評註:匹配中文還真是個頭疼的事,有了這個表達式就好辦了    匹配雙字節字符(包括漢字在內):[^x00-xff]  評註:可以用來計算字符串的長度(一個雙字節字符長度計2,ASC

原创 yii中添加驗證碼

轉載自:http://duchengjiu.iteye.com/blog/1833351 1、在SiteController中添加如下代碼: Php代碼   /**   * Declares class-based act

原创 yii中accessRules的使用

轉載自:http://duchengjiu.iteye.com/blog/1797966 訪問控制過濾器(Access Control Filter) 訪問控制過濾器是檢查當前用戶是否能執行訪問的controller action

原创 yii 1.1.*中數據提供者CActiveDataProvider和列表顯示組件CListView的使用

CActiveDataProvidershi基於ActiveRecord的一個數據提供者; CActiveDataProvider爲類modelClass的ActiveRecord對象提供數據,它使用AR類的CActiveRecord::

原创 yii 1.1.*中日期組件CJuiDatePicker的使用

<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(   'attribute'=>'my_date',//注意,如果要寫入數據庫,則要設置此變量;這個用於