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


PHP SSViewer::includeRequirements方法代码示例

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


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

示例1: testProcessOnlyIncludesRequirementsOnce

 public function testProcessOnlyIncludesRequirementsOnce()
 {
     $template = new SSViewer(array('SSViewerTestProcess'));
     $basePath = dirname($this->getCurrentRelativePath()) . '/forms';
     $backend = new Requirements_Backend();
     $backend->set_combined_files_enabled(false);
     $backend->combine_files('RequirementsTest_ab.css', array($basePath . '/RequirementsTest_a.css', $basePath . '/RequirementsTest_b.css'));
     Requirements::set_backend($backend);
     $this->assertEquals(1, substr_count($template->process(array()), "a.css"));
     $this->assertEquals(1, substr_count($template->process(array()), "b.css"));
     // if we disable the requirements then we should get nothing
     $template->includeRequirements(false);
     $this->assertEquals(0, substr_count($template->process(array()), "a.css"));
     $this->assertEquals(0, substr_count($template->process(array()), "b.css"));
 }
开发者ID:fanggu,项目名称:loveyourwater_ss_v3.1.6,代码行数:15,代码来源:SSViewerTest.php

示例2: execute_template

 /**
  * Execute the given template, passing it the given data.
  * Used by the <% include %> template tag to process templates.
  * 
  * @param string $template Template name
  * @param mixed $data Data context
  * @param array $arguments Additional arguments
  * @return string Evaluated result
  */
 public static function execute_template($template, $data, $arguments = null, $scope = null)
 {
     $v = new SSViewer($template);
     $v->includeRequirements(false);
     return $v->process($data, $arguments, $scope);
 }
开发者ID:tcaiger,项目名称:mSupplyNZ,代码行数:15,代码来源:SSViewer.php

示例3: RenderLayout

 /**
  * Mimics the bevahiour of $Layout in templates
  * @return HTMLText
  */
 public function RenderLayout()
 {
     $template = $this->findLayout();
     $subtemplateViewer = new SSViewer($template);
     $subtemplateViewer->includeRequirements(false);
     return $subtemplateViewer->process($this->getOwner());
 }
开发者ID:hubertusanton,项目名称:silverstripe-seo,代码行数:11,代码来源:SeoObjectExtension.php


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