新增页面跳转

<?php
//跳转类
class Redirect {
    //用于存放实例化的对象
    static private $_instance = null;
    
    //公共静态方法获取实例化的对象
    static public function getInstance() {
        if (!(self::$_instance instanceof self)) {
            self::$_instance = new self();
            self::$_instance->_tpl = $_tpl;
        }
        return self::$_instance;
    }
    
    //私有克隆
    private function __clone() {}
    
    //私有构造
    private function __construct() {}
    
    //成功跳转
    public function succ() {
        $this->_tpl->assign('message', $_info);
        $this->_tpl->assign('url', $_url);
        $this->_tpl->display(SMARTY_ADMIN.'public/succ.tpl');
        exit();
    }
    
    //失败返回
    public function error($_info) {
        $this->_tpl->assign('message', $_info);
        $this->_tpl->assign('prev', Tool::getPrevPage());
        $this->_tpl->display(SMARTY_ADMIN.'public/error.tpl');
        exit();
    }
}
?>

 

posted @ 2016-11-18 19:58  虚镜  阅读(354)  评论(0编辑  收藏  举报