Example #1
0
 /**
  * Create custom methods on demand to named redirect
  *
  * @param string $name
  * @param string $arguments
  * @return void
  */
 public function __call($name, $arguments)
 {
     $named_route = str_replace('redirect_to_', '', $name);
     if (substr($name, 0, 12) === 'redirect_to_') {
         $this->redirect(APP_DOMAIN . $this->request->url_for($named_route, $arguments));
     } else {
         trigger_error('Method ' . $name . ' not exist', E_USER_ERROR);
     }
 }