['onPluginsInitialized', 0], ]; } public function onPluginsInitialized() { /** @var Uri $uri */ $uri = $this->grav['uri']; $route = $this->config->get('plugins.admin.route'); if ($route && preg_match('#' . $route . '#', $uri->path())) { $this->enable([ 'onPageInitialized' => ['onPageInitialized', 0] ]); } } public function onPageInitialized() { $assets = $this->grav['assets']; $assets->addCss('user/plugins/darkadmin/darkadmin.css', 1); } }