本文整理汇总了PHP中PageTheme::getThemeCustomizableStyleSheets方法的典型用法代码示例。如果您正苦于以下问题:PHP PageTheme::getThemeCustomizableStyleSheets方法的具体用法?PHP PageTheme::getThemeCustomizableStyleSheets怎么用?PHP PageTheme::getThemeCustomizableStyleSheets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageTheme
的用法示例。
在下文中一共展示了PageTheme::getThemeCustomizableStyleSheets方法的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');
}
示例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');
}