YII页面跳转

$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;

  

上一篇:jquery多级手风琴插件–accordion.js


下一篇:Eclipse导出可执行Jar文件(包含第三方Jar包)