{ $viewFile = Yii::getAlias($viewFile); if ($this->theme !== null) { $viewFile = $this->theme->applyTo($viewFile); } if (is_file($viewFile)) { $viewFile = FileHelper::localize($viewFile); } else { throw new InvalidParamException("The view file does not exist: $viewFile"); } $oldContext = $this->context; if ($context !== null) { $this->context = $context; } $output = ''; $this->_viewFiles[] = $viewFile;
* @since 2.0.1 */ public function renderContent($content) { $layoutFile = $this->findLayoutFile($this->getView()); if ($layoutFile !== false) { return $this->getView()->renderFile($layoutFile, ['content' => $content], $this); } else { return $content; } } /**
* @return string the rendering result. * @throws InvalidParamException if the view file or the layout file does not exist. */ public function render($view, $params = []) { $content = $this->getView()->render($view, $params, $this); return $this->renderContent($content); } /** * Renders a static string by applying a layout. * @param string $content the static string being rendered * @return string the rendering result of the layout with the given static string as the `$content` variable.
if(!$cat){ throw new \yii\web\NotFoundHttpException('Article category not found.'); } return $this->render('index', [ 'cat' => $cat, 'items' => $cat->items(['tags' => $tag, 'pagination' => ['pageSize' => 6]]) ]); } public function actionCat($slug, $tag = null) { $cat = Article::cat($slug);
$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_tttt.php'); require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/app/config/web_tttt.php'); (new yii\web\Application($config))->run();
$_SERVER = [ 'CONTEXT_DOCUMENT_ROOT' => '/home/vietauscom/public_html/trumgame.com', 'CONTEXT_PREFIX' => '', 'DOCUMENT_ROOT' => '/home/vietauscom/public_html/trumgame.com', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'HTTP_ACCEPT' => '*/*', 'HTTP_ACCEPT_ENCODING' => 'gzip', 'HTTP_AUTHORIZATION' => '', 'HTTP_CDN_LOOP' => 'cloudflare', 'HTTP_CF_CONNECTING_IP' => '35.168.113.41', 'HTTP_CF_IPCOUNTRY' => 'US', 'HTTP_CF_RAY' => '866cc3a94a218f1c-IAD', 'HTTP_CF_VISITOR' => '{"scheme":"http"}', 'HTTP_CONNECTION' => 'Keep-Alive', 'HTTP_HOST' => 'trumgame.com', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_X_FORWARDED_FOR' => '35.168.113.41', 'HTTP_X_FORWARDED_PROTO' => 'http', 'PATH' => '/bin:/usr/bin', 'QUERY_STRING' => '', 'REDIRECT_HTTP_AUTHORIZATION' => '', 'REDIRECT_SCRIPT_URI' => 'http://trumgame.com/huong-dan.html', 'REDIRECT_SCRIPT_URL' => '/huong-dan.html', 'REDIRECT_STATUS' => '200', 'REDIRECT_UNIQUE_ID' => 'ZfloUyYEKt0mRNRE-2n1JQAAAFQ', 'REDIRECT_URL' => '/huong-dan.html', 'REMOTE_ADDR' => '172.70.134.116', 'REMOTE_PORT' => '31686', 'REQUEST_METHOD' => 'GET', 'REQUEST_SCHEME' => 'http', 'REQUEST_URI' => '/huong-dan.html', 'SCRIPT_FILENAME' => '/home/vietauscom/public_html/trumgame.com/index.php', 'SCRIPT_NAME' => '/index.php', 'SCRIPT_URI' => 'http://trumgame.com/huong-dan.html', 'SCRIPT_URL' => '/huong-dan.html', 'SERVER_ADDR' => '51.79.51.40', 'SERVER_ADMIN' => '[email protected]', 'SERVER_NAME' => 'trumgame.com', 'SERVER_PORT' => '80', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache', 'TZ' => 'UTC', 'UNIQUE_ID' => 'ZfloUyYEKt0mRNRE-2n1JQAAAFQ', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1710843987.467941, 'REQUEST_TIME' => 1710843987, 'argv' => [], 'argc' => 0, ]; $_SESSION = [ '__flash' => [], ]; $_ENV = [ 'CONTEXT_DOCUMENT_ROOT' => '/home/vietauscom/public_html/trumgame.com', 'CONTEXT_PREFIX' => '', 'DOCUMENT_ROOT' => '/home/vietauscom/public_html/trumgame.com', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'HTTP_ACCEPT' => '*/*', 'HTTP_ACCEPT_ENCODING' => 'gzip', 'HTTP_AUTHORIZATION' => '', 'HTTP_CDN_LOOP' => 'cloudflare', 'HTTP_CF_CONNECTING_IP' => '35.168.113.41', 'HTTP_CF_IPCOUNTRY' => 'US', 'HTTP_CF_RAY' => '866cc3a94a218f1c-IAD', 'HTTP_CF_VISITOR' => '{"scheme":"http"}', 'HTTP_CONNECTION' => 'Keep-Alive', 'HTTP_HOST' => 'trumgame.com', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_X_FORWARDED_FOR' => '35.168.113.41', 'HTTP_X_FORWARDED_PROTO' => 'http', 'PATH' => '/bin:/usr/bin', 'QUERY_STRING' => '', 'REDIRECT_HTTP_AUTHORIZATION' => '', 'REDIRECT_SCRIPT_URI' => 'http://trumgame.com/huong-dan.html', 'REDIRECT_SCRIPT_URL' => '/huong-dan.html', 'REDIRECT_STATUS' => '200', 'REDIRECT_UNIQUE_ID' => 'ZfloUyYEKt0mRNRE-2n1JQAAAFQ', 'REDIRECT_URL' => '/huong-dan.html', 'REMOTE_ADDR' => '172.70.134.116', 'REMOTE_PORT' => '31686', 'REQUEST_METHOD' => 'GET', 'REQUEST_SCHEME' => 'http', 'REQUEST_URI' => '/huong-dan.html', 'SCRIPT_FILENAME' => '/home/vietauscom/public_html/trumgame.com/index.php', 'SCRIPT_NAME' => '/index.php', 'SCRIPT_URI' => 'http://trumgame.com/huong-dan.html', 'SCRIPT_URL' => '/huong-dan.html', 'SERVER_ADDR' => '51.79.51.40', 'SERVER_ADMIN' => '[email protected]', 'SERVER_NAME' => 'trumgame.com', 'SERVER_PORT' => '80', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache', 'TZ' => 'UTC', 'UNIQUE_ID' => 'ZfloUyYEKt0mRNRE-2n1JQAAAFQ', ];