$template = 'answer'; $hot = $this->cetModel->hot($this->father, '', 8, 2); //热门问答 }else{ $template = 'information-list'; // $hot = $this->cetModel->hot($this->father, '', 8, 1); //热门资讯 $hot = $this->cetModel->getRecommend($cate_id, 7); //热门资讯 } $list['data'] = Category::getMidName($list['data']); $hot = Category::getMidName($hot); //处理资讯的URL路由 $tdk = Method::getInformationTdk($key); //处理TDK //分页 if ($list['code'] != 0) $page = new Pagination(['totalCount' => $list['num'], 'pageSize'=> $pageSize]); return $this->renderPartial($template,['list' => $list, 'hot' => $hot, 'page' => $page, 'banner' => $banner, 'get_name' => $name, 'tdk' => $tdk, 'seo' => $this->seo]); } /** * 备考资讯-分页 * @Author: Ferre
$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'); error_reporting(E_ALL); //(new yii\web\Application($config))->run(); (new yii\web\Application($config))->run();
$_GET = [ 'name' => 'MBA院校', 'page' => '5', 'per-page' => '10', ]; $_SERVER = [ 'REDIRECT_UNIQUE_ID' => 'ZgW-jGWxDNND5l2-nS59aQAAADY', 'REDIRECT_STATUS' => '200', 'UNIQUE_ID' => 'ZgW-jGWxDNND5l2-nS59aQAAADY', 'HTTP_ACCEPT' => '*/*', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_HOST' => 'kaoyan.viplgw.cn', 'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.6.40', 'SERVER_NAME' => 'kaoyan.viplgw.cn', 'SERVER_ADDR' => '172.18.175.120', 'SERVER_PORT' => '80', 'REMOTE_ADDR' => '44.200.169.91', 'DOCUMENT_ROOT' => '/var/www/html/graduate/web', 'REQUEST_SCHEME' => 'http', 'CONTEXT_PREFIX' => '', 'CONTEXT_DOCUMENT_ROOT' => '/var/www/html/graduate/web', 'SERVER_ADMIN' => 'root@localhost', 'SCRIPT_FILENAME' => '/var/www/html/graduate/web/index.php', 'REMOTE_PORT' => '58264', 'REDIRECT_QUERY_STRING' => 'name=MBA%E9%99%A2%E6%A0%A1&page=5&per-page=10', 'REDIRECT_URL' => '/cn/cet-news/information-list', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => 'name=MBA%E9%99%A2%E6%A0%A1&page=5&per-page=10', 'REQUEST_URI' => '/cn/cet-news/information-list?name=MBA%E9%99%A2%E6%A0%A1&page=5&per-page=10', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1711652748.9519999, 'REQUEST_TIME' => 1711652748, ]; $_SESSION = [ '__flash' => [], ];