Traq\Controllers\Admin\AppController::__construct PHP Method

__construct() public method

public __construct ( )
    public function __construct()
    {
        parent::__construct();
        $this->addCrumb($this->translate('admincp'), $this->generateUrl('admincp'));
        // Admins only, kthnxbai
        if (!$this->currentUser || !$this->currentUser->isAdmin()) {
            $this->before('*', function () {
                return $this->show403();
            });
        }
    }

Usage Example

Beispiel #1
0
 public function __construct()
 {
     parent::__construct();
     $this->addCrumb($this->translate('settings'), $this->generateUrl('admin_settings'));
     // Ticket history sorting select options
     $this->set('historySortingSelectOptions', [['label' => $this->translate("oldest_first"), 'value' => "oldest_first"], ['label' => $this->translate("newest_first"), 'value' => "newest_first"]]);
     Themes::index();
     $this->set('themes', Themes::selectOptions());
 }
All Usage Examples Of Traq\Controllers\Admin\AppController::__construct
AppController