当前位置: 首页>>代码示例>>PHP>>正文


PHP Twig_Environment::get_phpbb_config方法代码示例

本文整理汇总了PHP中Twig_Environment::get_phpbb_config方法的典型用法代码示例。如果您正苦于以下问题:PHP Twig_Environment::get_phpbb_config方法的具体用法?PHP Twig_Environment::get_phpbb_config怎么用?PHP Twig_Environment::get_phpbb_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Twig_Environment的用法示例。


在下文中一共展示了Twig_Environment::get_phpbb_config方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: compile

 /**
  * Compiles the node to PHP.
  *
  * @param \Twig_Compiler A Twig_Compiler instance
  */
 public function compile(\Twig_Compiler $compiler)
 {
     $compiler->addDebugInfo($this);
     $config = $this->environment->get_phpbb_config();
     $compiler->write("\$asset_file = ")->subcompile($this->getNode('expr'))->raw(";\n")->write("\$asset = new \\phpbb\\template\\asset(\$asset_file, \$this->getEnvironment()->get_path_helper());\n")->write("if (substr(\$asset_file, 0, 2) !== './' && \$asset->is_relative()) {\n")->indent()->write("\$asset_path = \$asset->get_path();")->write("\$local_file = \$this->getEnvironment()->get_phpbb_root_path() . \$asset_path;\n")->write("if (!file_exists(\$local_file)) {\n")->indent()->write("\$local_file = \$this->getEnvironment()->findTemplate(\$asset_path);\n")->write("\$asset->set_path(\$local_file, true);\n")->outdent()->write("\$asset->add_assets_version('{$config['assets_version']}');\n")->write("\$asset_file = \$asset->get_url();\n")->write("}\n")->outdent()->write("}\n")->write("\$context['definition']->append('{$this->get_definition_name()}', '");
     $this->append_asset($compiler);
     $compiler->raw("\n');\n");
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:13,代码来源:includeasset.php

示例2: compile

 /**
  * Compiles the node to PHP.
  *
  * @param \Twig_Compiler A Twig_Compiler instance
  */
 public function compile(\Twig_Compiler $compiler)
 {
     $compiler->addDebugInfo($this);
     $config = $this->environment->get_phpbb_config();
     if (!$config['tpl_allow_php']) {
         $compiler->write("// PHP Disabled\n");
         return;
     }
     $compiler->raw($this->getNode('text')->getAttribute('data'));
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:15,代码来源:php.php

示例3: compile

 /**
  * Compiles the node to PHP.
  *
  * @param \Twig_Compiler A Twig_Compiler instance
  */
 public function compile(\Twig_Compiler $compiler)
 {
     $compiler->addDebugInfo($this);
     $config = $this->environment->get_phpbb_config();
     if (!$config['tpl_allow_php']) {
         $compiler->write("// INCLUDEPHP Disabled\n");
         return;
     }
     if ($this->getAttribute('ignore_missing')) {
         $compiler->write("try {\n")->indent();
     }
     $compiler->write("\$location = ")->subcompile($this->getNode('expr'))->raw(";\n")->write("if (phpbb_is_absolute(\$location)) {\n")->indent()->write("require(\$location);\n")->outdent()->write("} else if (file_exists(\$this->getEnvironment()->get_phpbb_root_path() . \$location)) {\n")->indent()->write("require(\$this->getEnvironment()->get_phpbb_root_path() . \$location);\n")->outdent()->write("} else {\n")->indent()->write("require(\$this->getEnvironment()->getLoader()->getCacheKey(\$location));\n")->outdent()->write("}\n");
     if ($this->getAttribute('ignore_missing')) {
         $compiler->outdent()->write("} catch (\\Twig_Error_Loader \$e) {\n")->indent()->write("// ignore missing template\n")->outdent()->write("}\n\n");
     }
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:21,代码来源:includephp.php

示例4: compile

 /**
  * Compiles the node to PHP.
  *
  * @param \Twig_Compiler A Twig_Compiler instance
  */
 public function compile(\Twig_Compiler $compiler)
 {
     $compiler->addDebugInfo($this);
     $config = $this->environment->get_phpbb_config();
     $compiler->write("\$asset_file = ")->subcompile($this->getNode('expr'))->raw(";\n")->write("\$asset = new \\phpbb\\template\\asset(\$asset_file, \$this->getEnvironment()->get_path_helper(), \$this->getEnvironment()->get_filesystem());\n")->write("if (substr(\$asset_file, 0, 2) !== './' && \$asset->is_relative()) {\n")->indent()->write("\$asset_path = \$asset->get_path();")->write("\$local_file = \$this->getEnvironment()->get_phpbb_root_path() . \$asset_path;\n")->write("if (!file_exists(\$local_file)) {\n")->indent()->write("\$local_file = \$this->getEnvironment()->findTemplate(\$asset_path);\n")->write("\$asset->set_path(\$local_file, true);\n")->outdent()->write("}\n")->write("\$asset->add_assets_version('{$config['assets_version']}');\n")->outdent()->write("}\n")->write("\$context['definition']->set('STYLESHEETS', '__STYLESHEETS_PLACEHOLDER__');\n")->write("\$context['definition']->set('SCRIPTS', '__SCRIPTS_PLACEHOLDER__');\n")->write("\$this->getEnvironment()->get_assets_bag()->add_{$this->get_setters_name()}(\$asset);");
 }
开发者ID:Mtechnik,项目名称:phpbb,代码行数:11,代码来源:includeasset.php


注:本文中的Twig_Environment::get_phpbb_config方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。