} /** * 导航 一维数组 * 返回所有祖先 * @param integer $id 分类id * @return array 返回单线分类直到顶级分类 */ public function navi($id) { $parent = $this->result[$id]; $arr = array(); $arr[$parent[$this->fields[0]]] = $parent; while ($parent = $this->getItem($parent[$this->fields[1]])){ $arr[$parent[$this->fields[0]]] = $parent; } return array_reverse($arr); } /**
* 导航 一维数组 * 返回所有祖先 * @param integer $id 分类id * @return array 返回单线分类直到顶级分类 */ public function navi($id) { $parent = $this->result[$id]; $arr = array(); $arr[$parent[$this->fields[0]]] = $parent; while ($parent = $this->getItem($parent[$this->fields[1]])){ $arr[$parent[$this->fields[0]]] = $parent; } return array_reverse($arr);
{ $realTree = WebsiteModules::getTree(); $tree = WebsiteModules::getDataModulesTree(); $level = 0; $navIds = []; $currentId = \Yii::$app->request->get('id'); $currentId > 0 && $navIds = array_keys($realTree->navi($currentId)); return static::getMenuTree($tree, $level, $currentId, $navIds); } public static function renderUrl(){ $tree = WebsiteModules::getDataModulesTree(); $str=''; foreach ($tree as $val)
<?php /*动态缓存*/ echo $this->renderDynamic('return $this->render("//layouts/_jiamao");')?> <div class="dataleft"> <h4 class="tuij"><span class="cur"><?=Yii::t('app','数据产品')?></span> <a href="<?=Url::to(['/data/index-meal'])?>"><span><?=Yii::t('app','套餐')?></span></a></h4> <div class="panel-body" tabindex="5000" style="overflow: hidden; outline: none;"> <?= DataMenu::renderMenu();?> </div> </div> <div class="modal fade" id="modal-login" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header">
*/ public function renderPhpFile($_file_, $_params_ = []) { ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); require($_file_); return ob_get_clean(); } /** * Renders dynamic content returned by the given PHP statements.
$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.
</script> <?php Alert::widget();?> <!--下拉导航栏--> <div class="slidenav"> <?=$this->render('_left',[ 'model' => $model, ])?> <div class="datawap"> <div class="dataright"> <div class="price_sj" style="background:url('<?=$model->PIC_URL?>')"> <div class="prileft"> <h2><?=$model->getName()?></h2> <p class="pjs"><?=$model->getSummary()?></p>
*/ public function renderPhpFile($_file_, $_params_ = []) { ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); require($_file_); return ob_get_clean(); } /** * Renders dynamic content returned by the given PHP statements.
$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.
* These parameters will not be available in the layout. * @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
'pics_child'=>$pics_child, 'lifirst1'=>$html, 'lifirst2'=>$html0, 'lifirst3'=>$html1, 'jshtml'=>$js, 'havone'=>$havone ]); } public function actionOnepic() { $this->layout=false; $request = Yii::$app->request; if($request->isAjax)
if($model->URL) { //点击量 - 只统计枝叶节点,父节点点击量根据子节点求和 if(! $this->checkModuleRights($id)) { if($inframe) { return $this->renderPartial('iframe-login',['url'=>'/data/view?id='.$id]);exit; } return $this->actionBuyModule($flagId,$id);exit; } if(Yii::$app->user->getId()) { Yii::$app->vcounter->clickData($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();
$config['components']['urlManager']['rules']['<controller:(largedata)>/<action:(index)>/<id:\d+>']='<controller>/<action>'; $config['components']['urlManager']['rules']['<controller:(largedata)>/<action:(view)>/<id:\d+>/<inframe:\d+>/<num:\d+>']='<controller>/<action>'; $config['components']['urlManager']['rules']['<controller:(largedata)>/<action:(view)>/<id:\d+>']='<controller>/<action>'; $config['components']['urlManager']['rules']['<controller:(pts)>/<action:(index)>/<id:\d+>']='<controller>/<action>'; } $application = new yii\web\Application($config); $application->run();
$_GET = [ 'id' => '279', 'lang' => 'en', ]; $_SERVER = [ 'REDIRECT_STATUS' => '200', 'HTTP_ACCEPT' => '*/*', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_HOST' => 'bg.coalresource.com:90', 'PATH' => '/usr/local/php/bin:/usr/local/apache/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/maven/bin:/root/bin', 'LD_LIBRARY_PATH' => '/usr/local/apache/lib:/usr/lib/oracle/11.2/client64::/usr/local/openssl/lib', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache', 'SERVER_NAME' => 'bg.coalresource.com', 'SERVER_ADDR' => '10.0.0.12', 'SERVER_PORT' => '90', 'REMOTE_ADDR' => '54.81.185.66', 'DOCUMENT_ROOT' => '/web/english_test/frontend/web', 'REQUEST_SCHEME' => 'http', 'CONTEXT_PREFIX' => '', 'CONTEXT_DOCUMENT_ROOT' => '/web/english_test/frontend/web', 'SERVER_ADMIN' => 'you@example.com', 'SCRIPT_FILENAME' => '/web/english_test/frontend/web/index.php', 'REMOTE_PORT' => '37400', 'REDIRECT_URL' => '/data/view/279/en', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => '', 'REQUEST_URI' => '/data/view/279/en', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1710825825.125, 'REQUEST_TIME' => 1710825825, ]; $_SESSION = [ '__flash' => [], ];