本文整理匯總了PHP中SiteConfig::disable_theme方法的典型用法代碼示例。如果您正苦於以下問題:PHP SiteConfig::disable_theme方法的具體用法?PHP SiteConfig::disable_theme怎麽用?PHP SiteConfig::disable_theme使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SiteConfig
的用法示例。
在下文中一共展示了SiteConfig::disable_theme方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testAvailableThemes
function testAvailableThemes()
{
$config = SiteConfig::current_site_config();
$ds = DIRECTORY_SEPARATOR;
$testThemeBaseDir = TEMP_FOLDER . $ds . 'test-themes';
if (file_exists($testThemeBaseDir)) {
Filesystem::removeFolder($testThemeBaseDir);
}
mkdir($testThemeBaseDir);
mkdir($testThemeBaseDir . $ds . 'blackcandy');
mkdir($testThemeBaseDir . $ds . 'blackcandy_blog');
mkdir($testThemeBaseDir . $ds . 'darkshades');
mkdir($testThemeBaseDir . $ds . 'darkshades_blog');
$themes = $config->getAvailableThemes($testThemeBaseDir);
$this->assertContains('blackcandy', $themes, 'Test themes contain blackcandy theme');
$this->assertContains('darkshades', $themes, 'Test themes contain darkshades theme');
SiteConfig::disable_theme('darkshades');
$themes = $config->getAvailableThemes($testThemeBaseDir);
$this->assertFalse(in_array('darkshades', $themes), 'Darkshades was disabled - it is no longer available');
Filesystem::removeFolder($testThemeBaseDir);
}