<th>涨跌幅</th> <th>涨跌额</th> </tr> <?php $heyue_list = Json::decode($qihuo->contractlist); //截取$heyue_count 7条 $heyue_count = 7; $heyue_list = array_slice($heyue_list, 0,$heyue_count); $qihuolist_data = GetQihuo::getSinaQihuoData($heyue_list); foreach ($qihuolist_data as $q_d){ ?> <?php $changepercent = 0; if(floatval($q_d['trade']) && floatval($q_d['open'])){ $change = round((floatval($q_d['trade'])-floatval($q_d['open'])),6); $changepercent = round($change*100/floatval($q_d['open']),4); if($changepercent > 0){ $tabcl = " class=\"red_tab\" ";
<?php $heyue_list = Json::decode($qihuo->contractlist); //截取$heyue_count 7条 $heyue_count = 7; $heyue_list = array_slice($heyue_list, 0,$heyue_count); $qihuolist_data = GetQihuo::getSinaQihuoData($heyue_list); foreach ($qihuolist_data as $q_d){ ?> <?php $changepercent = 0; if(floatval($q_d['trade']) && floatval($q_d['open'])){ $change = round((floatval($q_d['trade'])-floatval($q_d['open'])),6); $changepercent = round($change*100/floatval($q_d['open']),4);
*/ 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;
public function renderFile($viewFile, $params = [], $context = null) { if ($this->theme == null) { $this->setTheme(); } return parent::renderFile($viewFile, $params, $context); } public function setTheme() { }
* @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
$model = $this->checkCategory($category,false); if(!empty($model)){ $arrparentid = explode(',', $model->arrparentid); if($this->checkFutruesCategory($model->url_alias)){ return $this->render('/public/sanjilanmu.php',['category'=>$model]); }elseif(count($arrparentid) == 2 && $this->id == 'qihuo'){ return $this->render('/public/lanmu.php',['category'=>$model]); }else { $query = Content::find(); if(!empty($model->id)){ $query->andFilterWhere(['category_id'=>$model->id,'pub_category_id'=>0,'status'=>Constants::Status_Publish]); } if(\Yii::$app->devicedetect->isMobile() || \Yii::$app->devicedetect->isTablet()){
$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); } }
$actionResult->action = $action; $result = $this->beforeAction($action); if ($runAction && $result === true) { $actionResult->isExecuted = true; $actionResult->result = $action->runWithParams($params); } else { $actionResult->isExecuted = false; $actionResult->result = $result; }
$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 = array_splice($this->catchAll, 1); } try { LuLu::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $actionsResult = $this->runAction($route, $params); $result = $actionsResult instanceof ActionResult ? $actionsResult->result : $actionsResult; if ($result instanceof \yii\web\Response) { return $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();
$application->defaultRoute='/site/index'; $siteStatus = Common::getConfigValue('sys_status'); if($siteStatus === '0') { $application->catchAll = ['/site/default/close', 'message' => 'test']; } $application->run();
$_GET = [ 'category' => 'nengyuan', ];