本文整理匯總了PHP中Gdn_Theme::_Section方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gdn_Theme::_Section方法的具體用法?PHP Gdn_Theme::_Section怎麽用?PHP Gdn_Theme::_Section使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gdn_Theme
的用法示例。
在下文中一共展示了Gdn_Theme::_Section方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: section
/**
* The current section the site is in. This can be one or more values. Think of it like a server-side css-class.
*
* @since 2.1
*
* @param string $Section The name of the section.
* @param string $Method One of: add, remove, set, get.
*/
public static function section($Section, $Method = 'add')
{
$Section = array_fill_keys((array) $Section, true);
switch (strtolower($Method)) {
case 'add':
self::$_Section = array_merge(self::$_Section, $Section);
break;
case 'remove':
self::$_Section = array_diff_key(self::$_Section, $Section);
break;
case 'set':
self::$_Section = $Section;
break;
case 'get':
default:
return array_keys(self::$_Section);
}
}