/** * Set up the token scope dropdown values * * @return array */ public function getTokenScopeOptions() { $tokenScopes = []; $scopes = TokensFacade::getScopeTokens(); foreach ($scopes as $scopeName) { $tokenScopes[$scopeName] = ucfirst($scopeName); } return $tokenScopes; }
/** * Register our event listener where we inject the variables * and our main classes */ public function register() { /** * Register a listener to inject the tokens before the * page and layout are rendered */ Event::listen('cms.page.init', function (CmsController $controller = null) { if (null === $controller) { return; } TokensFacade::initScopeTokens($controller); }); }