标签:
$criteria = new CDbCriteria; $criteria->select = array(‘ziduan"); $res = Model::model()->findAll($cirteria);
搜某一个字段
//当前域名 echo Yii::app()->request->hostInfo; //当前URLecho Yii::app()->request->getUrl(); //返回首页 echo Yii::app()->user->returnUrl; //提交后 防止重复提交 Ccontroler->refresh(); //上一页url 很有用哦 Yii::app()->request->urlReferrer; //获取ip地址 Yii::app()->request->userHostAddress; //yii execute后获取insert id $id = Yii::app()->db->getLastInsertID(); //yii获取get,post过来的数据 Yii::app()->request->getParam(‘id‘); //Yii->user(当前用户)相关 常用方法是class Controller extends CController { public $user = null; $this->user = Yii:app()->user; } this->user->isGuest; this->user->id; this->user->name;
标签:
原文地址:http://www.cnblogs.com/hsd1727728211/p/5810338.html