class ArticleController extends \yii\web\Controller { public function actionIndex() { return $this->render('index'); } public function actionDetails($id,$linkname) { $_artOne = Article::findArticleByLinkName($linkname); $_views = ++$_artOne->Views; $_artOne->Views = $_views; $_artOne->save(); $currentTime = time() - (7 * 24 * 60 * 60 * 4); $_popularArticles = Article::populateArticles($currentTime, $linkname); $_randomArticles = Article::randomArticles($linkname); // $_article = Article::findArticle($id); return $this->render('details', ['article' => $_artOne, 'popularArticles' => $_popularArticles, 'randomArticles' => $_randomArticles]); }
public function actionIndex() { return $this->render('index'); } public function actionDetails($id,$linkname) { $_artOne = Article::findArticleByLinkName($linkname); $_views = ++$_artOne->Views; $_artOne->Views = $_views; $_artOne->save(); $currentTime = time() - (7 * 24 * 60 * 60 * 4); $_popularArticles = Article::populateArticles($currentTime, $linkname); $_randomArticles = Article::randomArticles($linkname); // $_article = Article::findArticle($id);
$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__ . '/../../common/config/main-local.php'), require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php') ); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'linkname' => 'opinie-o-pozyczce-provident', 'id' => '258', ]; $_SERVER = [ 'TEMP' => '/home/platne/serwer72497/tmp', 'TMPDIR' => '/home/platne/serwer72497/tmp', 'TMP' => '/home/platne/serwer72497/tmp', 'USER' => 'serwer72497', 'HOME' => '/home/platne/serwer72497', 'SCRIPT_NAME' => '/index.php', 'REQUEST_URI' => '/artykuly/opinie-o-pozyczce-provident/258', 'QUERY_STRING' => '', 'REQUEST_METHOD' => 'GET', 'SERVER_PROTOCOL' => 'HTTP/2.0', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'REDIRECT_URL' => '/artykuly/opinie-o-pozyczce-provident/258', 'REMOTE_PORT' => '47020', 'SCRIPT_FILENAME' => '/home/virtuals/yousave.pl/index.php', 'SERVER_ADMIN' => '[no address given]', 'CONTEXT_DOCUMENT_ROOT' => '/home/virtuals/yousave.pl', 'CONTEXT_PREFIX' => '', 'REQUEST_SCHEME' => 'https', 'DOCUMENT_ROOT' => '/home/virtuals/yousave.pl', 'REMOTE_ADDR' => '54.88.179.12', 'SERVER_PORT' => '443', 'SERVER_ADDR' => '5.252.230.141', 'SERVER_NAME' => 'yousave.pl', 'SERVER_SOFTWARE' => 'Apache', 'SERVER_SIGNATURE' => '', 'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin', 'HTTP_HOST' => 'yousave.pl', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_ACCEPT' => '*/*', 'proxy-nokeepalive' => '1', 'SSL_TLS_SNI' => 'yousave.pl', 'HTTPS' => 'on', 'H2_STREAM_TAG' => '558506-1093-3', 'H2_STREAM_ID' => '3', 'H2_PUSHED_ON' => '', 'H2_PUSHED' => '', 'H2_PUSH' => 'off', 'H2PUSH' => 'off', 'HTTP2' => 'on', 'GEOIP_COUNTRY_NAME' => 'United States', 'GEOIP_COUNTRY_CODE' => 'US', 'GEOIP_CONTINENT_CODE' => 'NA', 'GEOIP_ADDR' => '54.88.179.12', 'REDIRECT_STATUS' => '200', 'REDIRECT_SSL_TLS_SNI' => 'yousave.pl', 'REDIRECT_HTTPS' => 'on', 'REDIRECT_H2_STREAM_TAG' => '558506-1093-3', 'REDIRECT_H2_STREAM_ID' => '3', 'REDIRECT_H2_PUSHED_ON' => '', 'REDIRECT_H2_PUSHED' => '', 'REDIRECT_H2_PUSH' => 'off', 'REDIRECT_H2PUSH' => 'off', 'REDIRECT_HTTP2' => 'on', 'REDIRECT_GEOIP_COUNTRY_NAME' => 'United States', 'REDIRECT_GEOIP_COUNTRY_CODE' => 'US', 'REDIRECT_GEOIP_CONTINENT_CODE' => 'NA', 'REDIRECT_GEOIP_ADDR' => '54.88.179.12', 'FCGI_ROLE' => 'RESPONDER', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1711711431.0909531, 'REQUEST_TIME' => 1711711431, ];