Gdn_Theme::section PHP Method

section() public static method

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
public static section ( string $Section, string $Method = 'add' )
$Section string The name of the section.
$Method string 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);
        }
    }

Usage Example

 /**
  * Runs before every call to this controller.
  */
 public function initialize()
 {
     parent::initialize();
     Gdn_Theme::section('Dashboard');
     set_time_limit(0);
     // Is this even doing anything?
 }
All Usage Examples Of Gdn_Theme::section