return $this->render('gallery', ['gallery' => $gallery]); } public function actionGallery_element(){ $gallery_id=\Yii::$app->request->get('gallery_id'); $gallery_categorie=GalleryCategorie::findOne($gallery_id); $gallery=Gallery::find()->where(['status'=>1,'gallery_categorie_id'=>$gallery_id])->orderBy('sort')->all(); Yii::$app->view->params['h1'] = $gallery_categorie->name; $this->layout = "textPage"; Yii::$app->view->title = $gallery_categorie->name; if (!empty($gallery_categorie->title_seo)) { Yii::$app->view->title = $gallery_categorie->title_seo; } return $this->render('gallery_element', ['gallery' => $gallery,'gallery_categorie'=>$gallery_categorie]); } public function actionContent_element(){
public function actionGallery_element(){ $gallery_id=\Yii::$app->request->get('gallery_id'); $gallery_categorie=GalleryCategorie::findOne($gallery_id); $gallery=Gallery::find()->where(['status'=>1,'gallery_categorie_id'=>$gallery_id])->orderBy('sort')->all(); Yii::$app->view->params['h1'] = $gallery_categorie->name; $this->layout = "textPage"; Yii::$app->view->title = $gallery_categorie->name; if (!empty($gallery_categorie->title_seo)) { Yii::$app->view->title = $gallery_categorie->title_seo; } return $this->render('gallery_element', ['gallery' => $gallery,'gallery_categorie'=>$gallery_categorie]);
$args = $this->controller->bindActionParams($this, $params); Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
} require(__DIR__ . '/../vendor/autoload.php'); require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/../config/web.php'); (new yii\web\Application($config))->run();
$_GET = [ 'gallery_id' => '29', ]; $_SERVER = [ 'REDIRECT_STATUS' => '200', 'HTTP_HOST' => 'shebip.ru', 'HTTP_X_REAL_IP' => '34.203.221.104', 'HTTP_X_FORWARDED_FOR' => '34.203.221.104', 'HTTP_CONNECTION' => 'close', 'HTTP_ACCEPT' => '*/*', 'HTTP_USER_AGENT' => 'claudebot', 'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'SERVER_SIGNATURE' => 'Apache/2.4.10 (Ubuntu) Server at shebip.ru Port 80 ', 'SERVER_SOFTWARE' => 'Apache/2.4.10 (Ubuntu)', 'SERVER_NAME' => 'shebip.ru', 'SERVER_ADDR' => '85.143.216.177', 'SERVER_PORT' => '80', 'REMOTE_ADDR' => '85.143.216.177', 'DOCUMENT_ROOT' => '/var/www/shebip.ru/www/yii2/web', 'REQUEST_SCHEME' => 'http', 'CONTEXT_PREFIX' => '', 'CONTEXT_DOCUMENT_ROOT' => '/var/www/shebip.ru/www/yii2/web', 'SERVER_ADMIN' => 'cyxenko@gmail.com', 'SCRIPT_FILENAME' => '/var/www/shebip.ru/www/yii2/web/index.php', 'REMOTE_PORT' => '35352', 'REDIRECT_URL' => '/gallery/29', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_PROTOCOL' => 'HTTP/1.0', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => '', 'REQUEST_URI' => '/gallery/29', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1711620012.964, 'REQUEST_TIME' => 1711620012, ];