本文整理汇总了PHP中Redirect::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::getInstance方法的具体用法?PHP Redirect::getInstance怎么用?PHP Redirect::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redirect
的用法示例。
在下文中一共展示了Redirect::getInstance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: authorized
public function authorized($url)
{
if (Auth::getInstance()->user() == false) {
if (strlen($url) > 0) {
Redirect::getInstance()->to($url)->go();
}
throw new \Exception("Accessing method forbidden", 402);
}
}
示例2: error
public function error($_url = '')
{
if (empty($_url)) {
$this->_tpl->assign('message', $this->_message);
$this->_tpl->assign('prev', Tool::getPrevPage());
$this->_tpl->display(SMARTY_ADMIN . 'public/error.tpl');
exit;
} else {
Redirect::getInstance()->succ($_url);
}
}
示例3: setAction
public static function setAction()
{
$_a = self::getA();
if (Validate::inArray($_a, array('manage', 'nav', 'level'))) {
if (!isset($_SESSION['admin'])) {
Redirect::getInstance()->succ('?a=admin&m=login');
}
}
if (!file_exists(ROOT_PATH . '/controller/' . $_a . 'Action.class.php')) {
$_a = 'index';
}
eval('self::$_obj = new ' . ucfirst($_a) . 'Action();');
return self::$_obj;
}
示例4: setAction
public static function setAction()
{
$temp = self::getA();
if (Validate::inArray($temp, array('Manage', 'Nav', 'Level', 'Goods', 'Order'))) {
if (!isset($_SESSION['admin'])) {
Redirect::getInstance()->success('', '?a=admin&m=runLogin');
}
}
if (!file_exists(ROOT_PATH . '/controller/' . $temp . 'Action.class.php')) {
$temp = 'Index';
}
eval('self::$obj=new ' . $temp . 'Action();');
return self::$obj;
}
示例5: showError
public function showError($url = '', $type = 0)
{
if (empty($url)) {
$this->tpl->assign('message', $this->message);
$this->tpl->assign('prev_url', PREV_URL);
if ($type == 0) {
$this->tpl->display(ADMIN_STYLE . 'public/error.tpl');
} else {
$this->tpl->display(ADMIN_STYLE . 'public/error_index.tpl');
}
exit;
} else {
Redirect::getInstance()->success('', './');
}
}
示例6: __construct
public function __construct()
{
$this->tpl = TPL::getInstance();
$this->model = Factory::setModel();
$this->redirect = Redirect::getInstance($this->tpl);
}
示例7: __construct
protected function __construct()
{
$this->_model = Factory::setModel();
$this->_tpl = TPL::getInstance();
$this->_redirect = Redirect::getInstance($this->_tpl);
}