diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index a2ce79e7..4014b8a4 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -309,7 +309,7 @@ public function relation($field) */ public function redirectUrl() { - $redirectUrl = $this->request->getQuery('_redirect_url'); + $redirectUrl = $this->getView()->getRequest()->getQuery('_redirect_url'); $redirectUrlViewVar = $this->getViewVar('_redirect_url'); if (!empty($redirectUrlViewVar)) { @@ -351,7 +351,7 @@ public function createRelationLink($alias, $relation, $options = []) 'action' => 'add', '?' => [ $relation['foreignKey'] => $this->getViewVar('primaryKeyValue'), - '_redirect_url' => $this->request->getUri()->getPath() + '_redirect_url' => $this->getView()->getRequest()->getUri()->getPath() ] ], $options @@ -432,7 +432,7 @@ public function getViewVar($key = null) */ public function getCssClasses() { - $action = (string)$this->request->getParam('action'); + $action = (string)$this->getView()->getRequest()->getParam('action'); $pluralVar = $this->getViewVar('pluralVar'); $viewClasses = (array)$this->getViewVar('viewClasses'); $args = func_get_args();