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


PHP Mustache_Engine::loadPartial方法代码示例

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


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

示例1: testLoadPartialCascading

 public function testLoadPartialCascading()
 {
     $loader = new Mustache_Loader_ArrayLoader(array('foo' => 'FOO'));
     $mustache = new Mustache_Engine(array('loader' => $loader));
     $tpl = $mustache->loadTemplate('foo');
     $this->assertSame($tpl, $mustache->loadPartial('foo'));
     $mustache->setPartials(array('foo' => 'f00'));
     // setting partials overrides the default template loading fallback.
     $this->assertNotSame($tpl, $mustache->loadPartial('foo'));
     // but it didn't overwrite the original template loader templates.
     $this->assertSame($tpl, $mustache->loadTemplate('foo'));
 }
开发者ID:baardbaard,项目名称:bb-twitterfeed,代码行数:12,代码来源:EngineTest.php

示例2: _load_theme_template

 /**
  * Loads the Mustache template or partial for the active theme.
  *
  * @param  array  $theme    Meta headers for the active theme
  * @param  array  $settings Gallery shortcode settings
  * @return void
  */
 protected function _load_theme_template($theme, $settings)
 {
     $loaders = array_merge(self::_load_theme_template_override($theme['plugin_override_path']), array(new Mustache_Loader_FilesystemLoader($theme['plugin_path'])));
     $partial_loaders = array_merge(self::_load_theme_template_override($theme['partials_override_path']), array(new Mustache_Loader_FilesystemLoader($theme['partials_path'])));
     $mustache = new Mustache_Engine(array('loader' => new Mustache_Loader_CascadingLoader($loaders), 'partials_loader' => new Mustache_Loader_CascadingLoader($partial_loaders)));
     $this->_template = isset($settings['partial']) ? $mustache->loadPartial(strtolower($settings['partial'])) : $mustache->loadTemplate(strtolower($theme['name']));
     // Backwards-Compatibility for Vimeography Pro < 0.7
     $this->_theme = $this->_template;
 }
开发者ID:raulmontejo,项目名称:vimeography,代码行数:16,代码来源:renderer.php


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