beforeRender event

@param \Cake\Event\Event $event Event.
@return void
430788
public function beforeRender(Event $event)
    {
        parent::beforeRender($event);

        $this->set('title', $this->Settings['alias']);
    }
178292
public function beforeFilter(\Cake\Event\Event $event)
    {
        parent::beforeFilter($event);

        // Auth-settings: Allows all user-related methods
        $this->Auth->allow(['resetPassword', 'forgotPassword', 'logout', 'login', 'activate', 'register']);

        // Setting up the base-theme
        if (!$this->theme) {
            $this->theme = "CakeManager";
        }

        // Setting up the base-layout
        if (!$this->layout) {
            $this->layout = "base";
        }

        $this->set('title', 'Users');
    }
951499
public function beforeRender(\Cake\Event\Event $event)
    {
        $this->_beforeRender($event);
        $this->Breadcrumb
            ->push('/admin/user/manage')
            ->push(__d('user', 'Virtual Fields'), '#');
    }
887671
public function beforeRenderFile(Event $event, $viewFile)
    {
        $pluginEvent = Plugin::getData('Core', 'View.beforeRenderFile');
        if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('View.beforeRenderFile')) {
            call_user_func_array($pluginEvent->find(0), [$this->_View, $event, $viewFile]);
        }
    }
240035
public function beforeDelete($event)
    {
        $oldId = $this->owner->{$this->savedAttribute};
        if (($oldModel = FileModel::findOne($oldId)) !== null) {
            $event->isValid = $event->isValid && $oldModel->delete();
        }
    }
42724
public function onBefore(BeforeEvent $event)
    {
        $request = $event->getRequest();
        $context = Tracer::spanContext();
        if ($context->enabled()) {
            $request->setHeader($this->propagator->key(), $this->propagator->formatter()->serialize($context));
        }
        $span = Tracer::startSpan([
            'name' => 'GuzzleHttp::request',
            'attributes' => [
                'method' => $request->getMethod(),
                'uri' => $request->getUrl()
            ],
            'kind' => Span::KIND_CLIENT
        ]);
        $this->scope = Tracer::withSpan($span);
    }
7019
public function beforeRun($event)
    {
        $id = $this->owner->options['id'];
        $options = Json::htmlEncode($this->getClientOptions());
        $view = $this->owner->getView();
        GridViewAsset::register($view);
        $view->registerJs("jQuery('#$id').yiiGridView($options);");
    }
5278
public function onBeforeRouting(Event $event): void
    {
        /** @var WebApplication $app */
        $app = $event['app'];

        if ($app->get('system.offline', false) && !$app->get('system.debug')) {
            $app->server->setHandler(
                function (RequestInterface $request, ResponseInterface $response, callable $next = null) {
                    $view = new HtmlView();
                    $view->setLayout('windwalker.offline.offline');

                    return new HtmlResponse($view->render());
                }
            );

            $app->server->listen();

            die;
        }
    }
612700
public static function onPreUpdate(Event $event)
    {
        $page = $event->getTarget();
        $eventArgs = $event->getEventArgs();

        if ($eventArgs instanceof PreUpdateEventArgs) {
            if ($eventArgs->hasChangedField('_workflow_state')) {
                $old = $eventArgs->getOldValue('_workflow_state');
                $new = $eventArgs->getNewValue('_workflow_state');

                if (null !== $new && null !== $listener = $new->getListenerInstance()) {
                    $listener->switchOnState($event);
                }

                if (null !== $old && null !== $listener = $old->getListenerInstance()) {
                    $listener->switchOffState($event);
                }
            }

            if ($eventArgs->hasChangedField('_state')) {
                if (
                    !($eventArgs->getOldValue('_state') & Page::STATE_ONLINE)
                    && $eventArgs->getNewValue('_state') & Page::STATE_ONLINE
                ) {
                    $event->getDispatcher()->triggerEvent('putonline', $page);
                } elseif (
                    $eventArgs->getOldValue('_state') & Page::STATE_ONLINE
                    && !($eventArgs->getNewValue('_state') & Page::STATE_ONLINE)
                ) {
                    $event->getDispatcher()->triggerEvent('putoffline', $page);
                }
            }
        }
    }
898829
public function beforeFilter(Event $event)
    {
        $this->_controller->set('__commentComponentLoaded__', true);
        $this->_controller->set('_commentFormContext', $this->config('arrayContext'));
    }
336589
private function captureOutlineOnBeforeOutlineEvent(Event $event)
    {
        if (!$event instanceof BeforeOutlineTested) {
            return;
        }

        $this->outline = $event->getOutline();
        $this->headerPrinted = false;
    }
1366640
public function beforeRender(Event $event)
    {
        $this->set('authUser', $this->authUser);
        $this->set('title', $this->name);

        $event = new Event('CakeAdmin.Controller.beforeRender', $this);
        EventManager::instance()->dispatch($event);
    }
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");
        }
    }
569452
protected function beforeRenderView()
    {
        $login = $this->getLoginProvider();

        if (isset($_GET["logout"])) {
            $login->logOut();
        }

        if ( $login->isLoggedIn() ){
            $this->onSuccess();
        }
    }
357749
public function beforePrepare(Event $event)
	{
		$command = $event['command'];

		if ($command->getName() !== 'createEntity') return;
		if (!$command['_id']) return;

		$operation = $command->getOperation();
		$operation->setHttpMethod('PUT');
	}
705018
public function beforeFilter(Event $event)
    {
        EventManager::trigger('Controller.setup', $this);

        $pluginEvent = Plugin::getData('Core', 'Controller.beforeFilter');
        if (is_callable($pluginEvent->find(0)) && Plugin::hasManifestEvent('Controller.beforeFilter')) {
            call_user_func_array($pluginEvent->find(0), [$this, $event]);
        }
    }
214472
public function beforePaginate(Event $event)
    {
        $method = 'contain';
        if (method_exists($event->getSubject()->query, 'getContain')) {
            $method = 'getContain';
        }
        $contained = $event->getSubject()->query->$method();

        if (!empty($contained)) {
            return;
        }

        $models = $this->models();
        if (empty($models)) {
            return;
        }

        $event->getSubject()->query->contain(array_keys($models));
    }