iwebshop二次开发(2)

设置模板为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'];


你可能感兴趣的:(开发,layout,iwebshop)