Redaxscript\Messenger::setRoute PHP Метод

setRoute() публичный Метод

set the relative redirect url
С версии: 3.0.0
public setRoute ( string $text = null, string $route = null ) : Messenger
$text string text of the action
$route string relative route of the action
Результат Messenger
    public function setRoute($text = null, $route = null)
    {
        if (strlen($text) && strlen($route)) {
            $this->_actionArray['text'] = $text;
            $this->_actionArray['route'] = $route;
            $this->_actionArray['url'] = $this->_registry->get('root') . '/' . $this->_registry->get('parameterRoute') . $this->_actionArray['route'];
        }
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * show the error
  *
  * @since 3.0.0
  *
  * @param array $errorArray
  *
  * @return string
  */
 protected function _error($errorArray = [])
 {
     $messenger = new Messenger($this->_registry);
     return $messenger->setRoute($this->_language->get('back'), 'register')->error($errorArray['message'], $this->_language->get('error_occurred'));
 }
All Usage Examples Of Redaxscript\Messenger::setRoute