Redaxscript\Messenger::setUrl PHP Method

setUrl() public method

set the absolute redirect url
Since: 3.0.0
public setUrl ( string $text = null, string $url = null ) : Messenger
$text string text of the action
$url string absolute url of the action
return Messenger
    public function setUrl($text = null, $url = null)
    {
        if (strlen($text) && strlen($url)) {
            $this->_actionArray['text'] = $text;
            $this->_actionArray['route'] = false;
            $this->_actionArray['url'] = $url;
        }
        return $this;
    }

Usage Example

Example #1
0
 /**
  * show the error
  *
  * @since 3.0.0
  *
  * @param array $errorArray array of the error
  *
  * @return string
  */
 protected function _error($errorArray = [])
 {
     $messenger = new Messenger($this->_registry);
     return $messenger->setUrl($this->_language->get('back'), $errorArray['url'])->error($errorArray['message'], $errorArray['title']);
 }
All Usage Examples Of Redaxscript\Messenger::setUrl