return $this->render('index', [ 'cat' => $cat ]); } public function actionView($slug) { $article = Article::get($slug); $cat = Article::cat($article->category_id); return $this->render('view', [ 'cat' => $cat, 'article' => $article ]); } }
]); } public function actionView($slug) { $article = Article::get($slug); $cat = Article::cat($article->category_id); return $this->render('view', [ 'cat' => $cat, 'article' => $article ]); }
$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__ . '/app/config/web.php'); (new yii\web\Application($config))->run();
$_GET = [ 'slug' => 'uvazaemye-abonenty', ]; $_SERVER = [ 'PHP_DOCUMENT_ROOT' => '/var/www/clients/client21/web40', 'PHPRC' => '/etc/php/5.6/cgi/', 'PWD' => '/var/www/php-fcgi-scripts/web40', 'TMP' => '/var/www/clients/client21/web40/tmp', 'PHP_FCGI_MAX_REQUESTS' => '5000', 'TMPDIR' => '/var/www/clients/client21/web40/tmp', 'SHLVL' => '0', 'TEMP' => '/var/www/clients/client21/web40/tmp', 'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'CONTENT_LENGTH' => '0', 'HTTP_CONNECTION' => 'close', 'SCRIPT_NAME' => '/index.php', 'REQUEST_URI' => '/news/view/uvazaemye-abonenty', 'QUERY_STRING' => '', 'REQUEST_METHOD' => 'GET', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'REDIRECT_URL' => '/news/view/uvazaemye-abonenty', 'REMOTE_PORT' => '49670', 'SCRIPT_FILENAME' => '/var/www/flink.uz/web/index.php', 'SERVER_ADMIN' => 'webmaster@flink.uz', 'CONTEXT_DOCUMENT_ROOT' => '/var/www/flink.uz/web', 'CONTEXT_PREFIX' => '', 'REQUEST_SCHEME' => 'https', 'DOCUMENT_ROOT' => '/var/www/flink.uz/web', 'REMOTE_ADDR' => '54.198.34.207', 'SERVER_PORT' => '443', 'SERVER_ADDR' => '91.234.218.5', 'SERVER_NAME' => 'flink.uz', 'SERVER_SOFTWARE' => 'Apache/2.4.25 (Debian)', 'SERVER_SIGNATURE' => 'Apache/2.4.25 (Debian) Server at flink.uz Port 443 ', 'HTTP_HOST' => 'flink.uz', 'HTTP_REFERER' => 'http://flink.uz/news/view/uvazaemye-abonenty', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_ACCEPT' => '*/*', 'SSL_TLS_SNI' => 'flink.uz', 'HTTPS' => 'on', 'REDIRECT_STATUS' => '200', 'REDIRECT_SSL_TLS_SNI' => 'flink.uz', 'REDIRECT_HTTPS' => 'on', 'FCGI_ROLE' => 'RESPONDER', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1711722021.528363, 'REQUEST_TIME' => 1711722021, ];