當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PageTheme::getThemeCustomizableStyleSheets方法代碼示例

本文整理匯總了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');
 }
開發者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::getThemeCustomizableStyleSheets方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。