//分页 $('.iPage').click(function () { var page = $(this).html(); var str = window.location.href; var catId = str.lastIndexOf("/"); str = str.substring(0, catId); <?php if (!empty($cate)) : ?> window.location.href = '<?php echo $cate; ?>' + '_' + page; <?php else : ?> <?php if(strstr($url_str, 'jijing')):?> window.location.href = str + '/jijing_' + page; <?php else:?> window.location.href = str + '/' + page + '.html'; <?php endif;?> <?php endif; ?> }); //咨询分页组装 // function referencePage(catId, page) { // $.post('/cn/api/reference-page', {catId: catId, page: page}, function (re) {
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @throws InvalidParamException if the view cannot be resolved or the view file does not exist. * @see renderFile() */ public function render($view, $params = [], $context = null) { $viewFile = $this->findViewFile($view, $context); return $this->renderFile($viewFile, $params, $context); } /** * Finds the view file based on the given view name. * @param string $view the view name or the path alias of the view file. Please refer to [[render()]] * on how to specify this parameter.
* @param array $params the parameters (name-value pairs) that should be made available in the view. * @return string the rendering result. * @throws InvalidParamException if the view file does not exist. */ public function renderPartial($view, $params = []) { return $this->getView()->render($view, $params, $this); } /** * Renders a view file. * @param string $file the view file to be rendered. This can be either a file path or a path alias. * @param array $params the parameters (name-value pairs) that should be made available in the view.
* @return string * @Obelisk */ public function exitData($arr,$dataType,$view="",$render='1'){ if($dataType == "arr"){ if($render == 1) { return $this->renderPartial($view, $arr); }else{ return $this->render($view, $arr); } }else{ die(json_encode($arr)); }
$tmp = array_filter(explode(',',$v['contentid'])); $ids = array_merge($ids, $tmp); } $ids_str = implode(',', $ids); $course_top = $model->getClass(['fields' => 'message,price','where' =>"c.id in ($ids_str)",'limit'=>3, 'order by c.createTime desc']); // var_dump($course_top);die; return $this->exitData(['str' => $str,'top' => $top,'pageStr' => $pageStr,'data' => $data, 'hot' => $hot, 'course_top' => $course_top],$dataType,"index"); } public function actionIndexNew() { $model = new Content(); $catId = Method::handleNewNews(); //获取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); } }
$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();
// default: // break; //} $config = require(__DIR__ . '/../config/web.php'); error_reporting(E_ALL); (new yii\web\Application($config))->run();
$_GET = [ 'catId' => '138', 'p' => '1', ]; $_SERVER = [ 'REDIRECT_UNIQUE_ID' => 'ZgU4RlYsJlppaklKZ@ZUmwAAAEo', 'REDIRECT_STATUS' => '200', 'UNIQUE_ID' => 'ZgU4RlYsJlppaklKZ@ZUmwAAAEo', 'HTTP_ACCEPT' => '*/*', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_REFERER' => 'http://www.toeflonline.cn/toeflnews/138/1.html', 'HTTP_HOST' => 'toefl.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' => 'toefl.viplgw.cn', 'SERVER_ADDR' => '172.18.175.120', 'SERVER_PORT' => '80', 'REMOTE_ADDR' => '44.220.131.93', 'DOCUMENT_ROOT' => '/var/www/html/toeflonline.cn/web', 'REQUEST_SCHEME' => 'http', 'CONTEXT_PREFIX' => '', 'CONTEXT_DOCUMENT_ROOT' => '/var/www/html/toeflonline.cn/web', 'SERVER_ADMIN' => 'root@localhost', 'SCRIPT_FILENAME' => '/var/www/html/toeflonline.cn/web/index.php', 'REMOTE_PORT' => '37122', 'REDIRECT_URL' => '/toeflnews/138/1.html', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => '', 'REQUEST_URI' => '/toeflnews/138/1.html', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1711618118.6140001, 'REQUEST_TIME' => 1711618118, ]; $_SESSION = [ '__flash' => [], ];