redirect() public method

Perform instant redirect to another page.
public redirect ( string $page = null, array $args = [] )
$page string
$args array
示例#1
0
文件: Installer.php 项目: atk4/atk4
 /**
  * @todo Description
  */
 public function initInstaller()
 {
     //$m = $this->layout->add('Menu');
     foreach (get_class_methods($this) as $method) {
         list(, $method) = explode('step_', $method);
         if (!$method) {
             continue;
         }
         if (is_null($this->s_first)) {
             $this->s_first = $method;
         }
         $this->s_last = $method;
         /*$u = */
         $this->url(null, array('step' => $method));
         $this->page = $this->pm->base_path . '?step=' . $_GET['step'];
         // $m->addMenuItem($u, ucwords(strtr($method, '_', ' ')));
         $this->page = null;
         if (is_null($this->s_current)) {
             ++$this->s_cnt;
             if ($method == $_GET['step']) {
                 $this->s_current = $method;
                 $this->s_title = ucwords(strtr($method, '_', ' '));
             } else {
                 $this->s_prev = $method;
             }
         } else {
             if (is_null($this->s_next)) {
                 $this->s_next = $method;
             }
         }
     }
     if (!$_GET['step']) {
         if ($this->show_intro) {
             return $this->showIntro($this->makePage('init'));
         }
         $this->app->redirect($this->stepURL('first'));
     }
     $this->initStep($this->s_current);
 }