Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dp-ifacesoft committed Sep 26, 2021
1 parent 65bbc97 commit 5e3618b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions source/Ice/Core/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -1078,23 +1078,18 @@ public function getRedirect()
}

/**
* @param string $route
* @param $routeOptions
* @param int $timeout
* @return $this
* @throws Exception
*/
public function setRedirect($routeOptions, $timeout = 0)
{
if (is_array($routeOptions)) {
list($route, $params, $urlWithGet, $urlWithDomain, $replaceContext) = array_pad((array)$routeOptions, 5, false);
} else {
list($route, $params, $urlWithGet, $urlWithDomain, $replaceContext) = [$routeOptions, [], null, null, null];
}
list($route, $params, $urlWithGet, $urlWithDomain, $replaceContext) = array_pad((array)$routeOptions, 5, null);

try {
$this->redirect = $route === true
? Router::getInstance()->getUrl([null, $params, $urlWithGet, $urlWithDomain, $replaceContext])
: Router::getInstance()->getUrl([$route, $params, $urlWithGet, $urlWithDomain, $replaceContext]);
$this->redirect = Router::getInstance()->getUrl([$route, (array)$params, $urlWithGet, $urlWithDomain, $replaceContext]);

App::getResponse()->setStatusCode(302);
} catch (RouteNotFound $e) {
$this->redirect = $route;
Expand Down Expand Up @@ -1184,7 +1179,7 @@ public function getWidget($widgetClass, $postfixKey = '')
? get_class($this) . $widgetClass
: Widget::getClass($widgetClass);

/** @var Widget $widget */
/** @var Widget $widget */
$widget = $widgetClass::getInstance($key . $postfixKey, null, $widgetParams);
// } catch (\Exception $e) {
// //todo: заменять на виджет сообщения об ошибке
Expand Down

0 comments on commit 5e3618b

Please sign in to comment.