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


PHP PageTheme::getStylesheetObject方法代码示例

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


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

示例1: testCustomizableStyleSheetObjects

 public function testCustomizableStyleSheetObjects()
 {
     $defaults = dirname(__FILE__) . '/fixtures/elemental.less';
     $list = \Concrete\Core\StyleCustomizer\Style\ValueList::loadFromLessFile($defaults);
     $env = Environment::get();
     $pt = new PageTheme();
     $pt->setThemeHandle('elemental');
     $pt->setThemeDirectory($env->getPath(DIRNAME_THEMES . '/elemental'));
     $pt->setThemeURL($env->getURL(DIRNAME_THEMES . '/elmental'));
     $sheets = $pt->getThemeCustomizableStyleSheets();
     $this->assertTrue(count($sheets) == 1);
     $this->assertTrue($sheets[0] instanceof \Concrete\Core\StyleCustomizer\Stylesheet);
     $css = $sheets[0]->getCss();
     $this->assertTrue(strpos($css, "background-image: url('/path/to/server/concrete/themes/elemental/images/background-slider-default.png')") !== false);
     $sheets[0]->setValueList($list);
     $css = $sheets[0]->getCss();
     $this->assertTrue(strpos($css, "background-image: url('/path/to/server/concrete/themes/elemental/images/testingit.jpg')") !== false);
     $this->assertTrue(strpos($css, 'font-family: "Testing Font Family"') !== false);
     $sheet = $pt->getStylesheetObject('typography.less');
     $sheet->setValueList($list);
     $this->assertTrue($sheet->getOutputPath() == DIR_BASE . '/application/files/cache/css/elemental/typography.css');
     $this->assertTrue($sheet->getOutputRelativePath() == DIR_REL . '/application/files/cache/css/elemental/typography.css');
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:23,代码来源:StyleTest.php

示例2: testCustomizableStyleSheetObjects

 public function testCustomizableStyleSheetObjects()
 {
     $defaults = dirname(__FILE__) . '/fixtures/greekyogurt.less';
     $list = \Concrete\Core\StyleCustomizer\Style\ValueList::loadFromLessFile($defaults);
     $env = Environment::get();
     $pt = new PageTheme();
     $pt->setThemeHandle('greek_yogurt');
     $pt->setThemeDirectory($env->getPath(DIRNAME_THEMES . '/greek_yogurt'));
     $pt->setThemeURL($env->getURL(DIRNAME_THEMES . '/greek_yogurt'));
     $sheets = $pt->getThemeCustomizableStyleSheets();
     $this->assertTrue(count($sheets) == 1);
     $this->assertTrue($sheets[0] instanceof \Concrete\Core\StyleCustomizer\Stylesheet);
     $css = $sheets[0]->getCss();
     $r = preg_match('/background-image: url\\(\'(.+)\'\\);/i', $css, $matches);
     $this->assertTrue(trim($matches[1]) == '/concrete/themes/greek_yogurt/images/spacer.gif');
     $sheets[0]->setValueList($list);
     $css = $sheets[0]->getCss();
     $r = preg_match('/background-image: url\\(\'(.+)\'\\);/i', $css, $matches);
     $this->assertTrue(trim($matches[1]) == '/concrete/themes/greek_yogurt/images/testingit.jpg');
     $sheet = $pt->getStylesheetObject('typography.less');
     $sheet->setValueList($list);
     $this->assertTrue($sheet->getOutputPath() == DIR_BASE . '/application/files/cache/css/greek_yogurt/typography.css');
     $this->assertTrue($sheet->getOutputRelativePath() == DIR_REL . '/application/files/cache/css/greek_yogurt/typography.css');
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:24,代码来源:StyleTest.php


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