Before Controller _actionRead is executed.

@param AnEvent $event Dispatcher event
963191
public function onBeforeControllerGet(AnEvent $event)
    {
        $this->getController()->menubar = $this;

        $title[] = strtoupper('COM-'.$this->getController()
                                          ->getIdentifier()
                                          ->package.'-'.$this
                                          ->getController()
                                          ->getIdentifier()
                                          ->name.'-PAGE-HEADER');
        $title[] = strtoupper('COM-'.$this->getController()
                                          ->getIdentifier()
                                          ->package.'-HEADER');

        $this->setTitle(translate($title));
    }
1071750
protected function beforeDispatch(string $eventName, $event)
    {
        $this->preDispatch($eventName, $event instanceof Event ? $event : new LegacyEventProxy($event));
    }
1333335
public function onBeforeControllerGet(AnEvent $event)
    {
        parent::onBeforeControllerGet($event);

        $viewer = $this->getController()->viewer;
        $actor = pick($this->getController()->actor, $viewer);
        $layout = pick($this->getController()->getRequest()->layout, 'default');
        $name = $this->getController()->getIdentifier()->name;

        //create title
        if ($layout == 'upload') {
            $this->setTitle(AnTranslator::sprintf('COM-PHOTOS-UPLOAD-PHOTOS', $actor->name));
        } elseif ($name == 'set') {
            $this->setTitle(AnTranslator::sprintf('COM-PHOTOS-HEADER-ACTOR-SETS', $actor->name));
        } else {
            $this->setTitle(AnTranslator::sprintf('COM-PHOTOS-HEADER-ACTOR-PHOTOS', $actor->name));
        }

        //create navigations
        $this->addNavigation('photos',
            AnTranslator::_('COM-PHOTOS-LINKS-PHOTOS'),
            array('option' => 'com_photos', 'view' => 'photos', 'oid' => $actor->uniqueAlias),
            $name == 'photo' && (in_array($layout, array('default', 'add', 'masonry'))));

        if ($actor->photos->getTotal() > 0) {
            $this->addNavigation('sets', AnTranslator::_('COM-PHOTOS-LINKS-SETS'),
            array('option' => 'com_photos', 'view' => 'sets', 'oid' => $actor->uniqueAlias),
            $name == 'set' && in_array($layout, array('default', 'add', 'edit')));
        }
    }
951499
public function beforeRender(\Cake\Event\Event $event)
    {
        $this->_beforeRender($event);
        $this->Breadcrumb
            ->push('/admin/user/manage')
            ->push(__d('user', 'Virtual Fields'), '#');
    }
976854
public function onBefore(BeforeEvent $event)
    {
        $request = $event->getRequest();
        if ($request->getConfig()->get('auth') == 'oauth2') {
            $token = $this->getAccessToken();
            if ($token !== null) {
                $request->setHeader('Authorization', 'Bearer ' . $token->getToken());
            }
        }
    }
1048641
public function onSettingDisplay(AnEvent $event)
    {
        $actor = $event->actor;
        $tabs = $event->tabs;
        $this->_setSettingTabs($actor, $tabs);
    }
172150
public function dispatchEvent($eventName, Event $event = null)
    {
        if ($this->eventDispatcher instanceof EventDispatcherInterface) {
            $this->eventDispatcher->dispatch($eventName, $event);
        }
    }
219180
public function before($event = []) {
		$ds = ConnectionManager::getDataSource($this->connection);
		$ds->cacheSources = false;

		return true;
	}
936713
public function onSettingDisplay(AnEvent $event)
    {
        $tabs = $event->tabs;
        $viewer = get_viewer();

        if ($viewer->admin() || $viewer->eql($this->getItem())) {
            $tabs->insert('account', array('label' => AnTranslator::_('COM-PEOPLE-SETTING-TAB-ACCOUNT')));
        }
    }
453667
public function beforeApiRequestSend($event)
    {
        $request = $event->request;
        $data = $request->getData();
        $data['openid'] = $this->getOpenid();
        $request->setData($data);

        parent::beforeApiRequestSend($event);
    }
124200
public function beforeRender(Event $event) {
		/** @var \Cake\Controller\Controller $controller */
		$controller = $event->getSubject();
		$controller->viewBuilder()->setClassName($this->_config['viewClass']);

		// Set flash messages to the view
		if ($this->_config['flashKey']) {
			$message = $controller->getRequest()->getSession()->consume($this->_config['flashKey']);
			if ($message || !array_key_exists('_message', $controller->viewVars)) {
				$controller->set('_message', $message);
			}
		}

		// If _serialize is true, *all* viewVars will be serialized; no need to add _message.
		if ($this->_isSerializeTrue($controller)) {
			return;
		}

		$serializeKeys = ['_message'];
		if (!empty($controller->viewVars['_serialize'])) {
			$serializeKeys = array_merge((array)$controller->viewVars['_serialize'], $serializeKeys);
		}
		$controller->set('_serialize', $serializeKeys);
	}
306705
public function onBeforeControllerGet(AnEvent $event)
    {
        parent::onBeforeControllerGet($event);

        $viewer = get_viewer();
        $actor = pick($this->getController()->actor, $viewer);
        $layout = pick($this->getController()->layout, 'default');
        $name = $this->getController()->getIdentifier()->name;

        $this->setTitle(AnTranslator::sprintf('COM-ARTICLES-ACTOR-HEADER-'.strtoupper($name).'S', $actor->name));

        //create navigations
        $this->addNavigation('articles',
                        AnTranslator::_('COM-ARTICLES-LINK-ARTICLES'),
                        array(
                            'option' => 'com_articles',
                            'view' => 'articles',
                            'oid' => $actor->id, ),
                        $name == 'article');
    }
336589
private function captureOutlineOnBeforeOutlineEvent(Event $event)
    {
        if (!$event instanceof BeforeOutlineTested) {
            return;
        }

        $this->outline = $event->getOutline();
        $this->headerPrinted = false;
    }
502728
public function beforeRender($event)
    {
        $this->Controller->set('authUser', $this->Controller->authUser);

        // beforeRender-event
        $_event = new Event('Component.Manager.beforeRender', $this, [
        ]);
        $this->Controller->eventManager()->dispatch($_event);

        if ($this->isPrefix()) {
            $this->_runCallback("beforeRender", $event);

            // beforeRender-event with Prefix
            $this->_runEvent("beforeRender");
        }
    }
142679
public function onMenuDisplay(AnEvent $event)
    {
        $actor = $event->actor;
        $menuItems = $event->menuItems;

        if ($this->activeForActor($actor)) {
            $this->_setMenuLinks($actor, $menuItems);
        }
    }
537245
public function beforeRender(Event $event)
    {
        parent::beforeRender($event);

        $this->set('type', $this->type);
        $this->set('title', $this->type['name']);
    }
122841
public function beforeFilter(Event $event)
    {
        $this->controller = $event->getSubject();
        $this->request = $this->controller->request;
        $this->action = $this->request->getParam('action');
        $this->Filters = TableRegistry::get($this->getConfig('filterTable'));

        $this->_setupSort();
        $this->_setupFilters();
        $this->_setupPagination();
    }