设置模板为mini模式,类似于JSP中的sitemesh
public $layout='site_mini';
登录模块实现
function wuliu_login() { //如果已经登录,就跳到ucenter页面 if( ISafe::get('user_id') != null ) { ISafe::clearAll();//清除已经登录的信息 //$this->redirect("/ucenter/index"); } $username = IFilter::act(IReq::get('login_info','post')); $password = IReq::get('password','post'); $model = new IModel('wuliu_admin'); $wuliu_admin = $model->getObj('username = "'.$username.'" and password = "'.$password.'"'); //echo($wuliu_admin['password']); if($wuliu_admin) { echo("登陆成功"); } else { echo("登录失败"); } }
取数组中的值
print_r($this->getProperty()); Array ( [user] => Array ( [user_id] => 1 [username] => umgsai [head_ico] => [user_pwd] => ed94ba2f17a6dba8eda45fee74805b95 ) ) $test = $this->getProperty(); echo $test['user']['user_id'];
本文出自 “阿凡达” 博客,请务必保留此出处http://shamrock.blog.51cto.com/2079212/1318735