* * @var array */ static $_tag_objects = array(); /** * counter for prefix variable number * * @var int */ public static $prefixVariableNumber = 0; /** * Smarty object * * @var Smarty */ public $smarty = null; /** * Parser object *
$this->mapCache[ 'all' ] = array_fill_keys(array_merge($this->required_attributes, $this->optional_attributes, $this->option_flags), true); } foreach ($_indexed_attr as $key => $dummy) { if (!isset($this->mapCache[ 'all' ][ $key ]) && $key !== 0) { $compiler->trigger_template_error("unexpected '{$key}' attribute", null, true); } } } // default 'false' for all option flags not set foreach ($this->option_flags as $flag) { if (!isset($_indexed_attr[ $flag ])) {
* @return string * @throws \SmartyException */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) { // check and get attributes $_attr = $this->getAttributes($compiler, $args); $output = $parameter[ 'value' ]; // tag modifier if (!empty($parameter[ 'modifierlist' ])) { $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter[ 'modifierlist' ], 'value' => $output));
*/ public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null) { /* @var Smarty_Internal_CompileBase $tagCompiler */ $tagCompiler = $this->getTagCompiler($tag); // compile this tag return $tagCompiler === false ? false : $tagCompiler->compile($args, $this, $param1, $param2, $param3); } /** * lazy loads internal compile plugin for tag compile objects cached for reuse. * * class name format: Smarty_Internal_Compile_TagName
$this->tag_nocache = true; } } } } // compile the smarty tag (required compile classes to compile the tag are auto loaded) if (($_output = $this->callTagCompiler($tag, $args, $parameter)) === false) { if (isset($this->parent_compiler->tpl_function[ $tag ]) || (isset ($this->template->smarty->ext->_tplFunction) && $this->template->smarty->ext->_tplFunction->getTplFunction($this->template, $tag) !== false) ) { // template defined by {template} tag $args[ '_attr' ][ 'name' ] = "'{$tag}'";
* @return string compiled code */ public function compileTag($tag, $args, $parameter = array()) { $this->prefixCodeStack[] = $this->prefix_code; $this->prefix_code = array(); $result = $this->compileTag2($tag, $args, $parameter); $this->prefix_code = array_merge($this->prefix_code, array_pop($this->prefixCodeStack)); return $result; } /** * compile variable
if ($this->security) { $this->security->isTrustedConstant($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler); } $this->_retvalue = $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, array('value' => $this->yystack[ $this->yyidx + -1 ]->minor)); } else { $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); } }
self::$yyRuleName[ $yyruleno ]); } $this->_retvalue = $yy_lefthand_side = null; if (isset(self::$yyReduceMap[ $yyruleno ])) { // call the action $this->_retvalue = null; $this->{'yy_r' . self::$yyReduceMap[ $yyruleno ]}(); $yy_lefthand_side = $this->_retvalue; } $yygoto = self::$yyRuleInfo[ $yyruleno ][ 0 ]; $yysize = self::$yyRuleInfo[ $yyruleno ][ 1 ]; $this->yyidx -= $yysize; for ($i = $yysize; $i; $i--) {
if ($yyendofinput && $this->yyidx >= 0) { $yymajor = 0; } else { $yymajor = self::YYNOCODE; } } else if ($yyact < self::YYNSTATE + self::YYNRULE) { $this->yy_reduce($yyact - self::YYNSTATE); } else if ($yyact === self::YY_ERROR_ACTION) { if ($this->yyTraceFILE) { fprintf($this->yyTraceFILE, "%sSyntax Error!\n", $this->yyTracePrompt); }
// get tokens from lexer and parse them while ($this->parser->lex->yylex()) { if ($this->smarty->_parserdebug) { echo "<pre>Line {$this->parser->lex->line} Parsing {$this->parser->yyTokenName[$this->parser->lex->token]} Token " . htmlentities($this->parser->lex->value) . "</pre>"; } $this->parser->doParse($this->parser->lex->token, $this->parser->lex->value); } // finish parsing process $this->parser->doParse(0, 0); if ($mbEncoding) { mb_internal_encoding($mbEncoding);
$_content = Smarty_Internal_Compile_Extends::extendsSourceArrayCode($this->template); } else { // get template source $_content = $this->template->source->getContent(); } $_compiled_code = $this->postFilter($this->doCompile($this->preFilter($_content), true)); } catch (Exception $e) { if ($this->smarty->debugging) { $this->smarty->_debug->end_compile($this->template); } $this->_tag_stack = array();
public function compileTemplate(Smarty_Internal_Template $template, $nocache = null, Smarty_Internal_TemplateCompilerBase $parent_compiler = null) { // get code frame of compiled template $_compiled_code = $template->smarty->ext->_codeFrame->create($template, $this->compileTemplateSource($template, $nocache, $parent_compiler), $this->postFilter($this->blockOrFunctionCode) . join('', $this->mergedSubTemplatesCode), false, $this);
touch($this->filepath); } // compile locking try { // call compiler $_template->loadCompiler(); $this->write($_template, $_template->compiler->compileTemplate($_template)); } catch (Exception $e) { // restore old timestamp in case of error if ($saved_timestamp && is_file($this->filepath)) { touch($this->filepath, $saved_timestamp); }
if ($source->handler->recompiled) { $source->handler->process($_smarty_tpl); } else if (!$source->handler->uncompiled) { if (!$this->exists || $smarty->force_compile || ($_smarty_tpl->compile_check && $source->getTimeStamp() > $this->getTimeStamp()) ) { $this->compileTemplateSource($_smarty_tpl); $compileCheck = $_smarty_tpl->compile_check; $_smarty_tpl->compile_check = Smarty::COMPILECHECK_OFF; $this->loadCompiledTemplate($_smarty_tpl); $_smarty_tpl->compile_check = $compileCheck; } else { $_smarty_tpl->mustCompile = true;
if (!isset($_template->smarty->_debug)) { $_template->smarty->_debug = new Smarty_Internal_Debug(); } $_template->smarty->_debug->start_render($_template); } if (!$this->processed) { $this->process($_template); } if (isset($_template->cached)) { $_template->cached->file_dependency = array_merge($_template->cached->file_dependency, $this->file_dependency); } if ($_template->source->handler->uncompiled) {
} $this->cached->render($this, $no_output_filter); } else { if (!isset($this->compiled) || $this->compiled->compile_id !== $this->compile_id) { $this->loadCompiled(true); } $this->compiled->render($this); } // display or fetch if ($display) { if ($this->caching && $this->smarty->cache_modified_check) { $this->smarty->ext->_cacheModify->cacheModifiedCheck($this->cached, $this,
} ob_start(); $template->_mergeVars(); if (!empty(Smarty::$global_tpl_vars)) { $template->tpl_vars = array_merge(Smarty::$global_tpl_vars, $template->tpl_vars); } $result = $template->render(false, $function); $template->_cleanUp(); if ($saveVars) { $template->tpl_vars = $savedTplVars; $template->config_vars = $savedConfigVars; } else { if (!$function && !isset(Smarty_Internal_Template::$tplObjCache[ $template->templateId ])) {
* @throws Exception * @throws SmartyException * @return string rendered template output */ public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null) { $result = $this->_execute($template, $cache_id, $compile_id, $parent, 0); return $result === null ? ob_get_clean() : $result; } /** * displays a Smarty template *
// Make Yii params available as smarty config variables $template->config_vars = Yii::$app->params; $template->assign('app', \Yii::$app); $template->assign('this', $view); return $template->fetch(); } /** * Resolves Yii alias into file path * * @param string $type
if (isset($this->renderers[$ext])) { if (is_array($this->renderers[$ext]) || is_string($this->renderers[$ext])) { $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); }
* @throws InvalidCallException if the view cannot be resolved. * @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](guide:concept-aliases) 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 InvalidArgumentException 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
$this->params['page'] = [ 'title' => '新闻资讯_微瑞细易欧', 'keywords' => '微瑞细易欧,营销系统,分销系统,订货系统,SCRM会员系统,社区新零售', 'description' => '微瑞细易欧,总部设立于上海,定位为“营销系统解决方案服务商”,以“积极倡导高效的营销理念,提供专业的营销系统解决方案,帮助企业实现最大的业务提升”为使命,为企业提供营销系统建设服务;微瑞细易欧拥有自主知识产权的营销系统四大系列产品,包括分销系统、SCRM会员系统、活动营销系统、SAAS导购系统。' ]; return $this->render('../news.xinwenzixun.html', $this->params); } public function actionHangyedongcha() { // 首页标识 $this->params['index'] = true; $this->params['News'] = ' on';
$args = $this->controller->bindActionParams($this, $params); Yii::debug('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); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ 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.php', require __DIR__ . '/../../common/config/main-local.php', require __DIR__ . '/../config/main.php', require __DIR__ . '/../config/main-local.php' ); (new yii\web\Application($config))->run();
$_GET = [ 'page' => '1', ];