Called after the Controller::beforeFilter() and before the controller action

Actions:
- Set global variables for View;
- Setting search form input;
- Update configuration of plugin.

@param Controller $controller Controller instance.
@return void
483959
public function startup(Controller $controller) {
		$this->_setConfig();
		if (!$this->_controller->ViewExtension->isHtml()) {
			return;
		}

		$targetDeep = $this->_modelConfigSearchInfo->getTargetDeep();
		$querySearchMinLength = $this->_modelConfigSearchInfo->getQuerySearchMinLength();
		$targetFieldsSelected = $this->getTargetList();
		$targetFields = $this->_modelSearch->getTargetFields();

		$controller->set('search_targetDeep', $targetDeep);
		$controller->set('search_querySearchMinLength', $querySearchMinLength);
		$controller->set('search_targetFieldsSelected', $targetFieldsSelected);
		$controller->set('search_targetFields', $targetFields);
	}
637144
private function initialize(AbstractController $controller)
    {
        foreach ($this->initializers as $initializer) {
            if ($initializer instanceof InitializerInterface) {
                $initializer->initialize($controller, $this);
            } else {
                call_user_func($initializer, $controller, $this);
            }
        }
    }
351014
public function startup($controller = null)
    {
        if (!$controller) {
            $controller = new Controller(new Request());
        }
        $registry = new ComponentRegistry();
        $this->Acl = new AclComponent($registry, Configure::read('Acl'));
        $this->Aco = $this->Acl->Aco;
        $this->controller = $controller;
        $this->_buildPrefixes();
        $this->_processIgnored();
    }
725362
public function render($controller = null)
    {
        // If we have parent module connection and have no view set
        if (isset($this->parent) && $this->view_path == false /*&& !method_exists($this, $controller)*/) {
            // Merge current and parent module view data
            $this->parent->view_data = array_merge($this->parent->view_data, $this->view_data);
            // Set internal view context data pointer
            $this->parent->data = &$this->parent->view_data[$this->parent->view_context];
            // Call parent render
            $this->parent->render($controller);
        } else { // Call default module behaviour
            parent::render($controller);
        }
    }
486431
protected function _addSpecificDetector(Controller &$controller) {
		$controller->request->addDetector(
			'msie',
			['env' => 'HTTP_USER_AGENT', 'pattern' => '/imsie|trident/i']
		);
		$controller->request->addDetector(
			'pjax',
			['env' => 'HTTP_X_PJAX', 'value' => true]
		);
		$controller->request->addDetector(
			'sse',
			['param' => 'ext', 'value' => 'sse']
		);
		$controller->request->addDetector(
			'modal',
			['param' => 'ext', 'value' => 'mod']
		);
		$controller->request->addDetector(
			'popup',
			['param' => 'ext', 'value' => 'pop']
		);
		$controller->request->addDetector(
			'print',
			['param' => 'ext', 'value' => 'prt']
		);
	}
763270
public static function contentcontrollerInit($controller)
    {
        $subsite = Subsite::currentSubsite();

        if ($subsite && $subsite->Theme) {
            SSViewer::add_themes([$subsite->Theme]);
        }

        if ($subsite && i18n::getData()->validate($subsite->Language)) {
            i18n::set_locale($subsite->Language);
        }
    }
763374
protected function _beforeControllerValidate()
    {
        if (!isset($this->_validator)) {
            $this->setValidator($this->_mixer->getIdentifier()->name);
        }
    }
1236764
public function startup(Controller $controller) {
		if ($this->settings['isTest']) {
			return;
		}

		foreach ($this->routes as $route) {
			if (!$this->_parse($route['route'])) {
				continue;
			}

			if (!$this->_execute($route)) {
				break;
			}

			$this->Session->write('Sanction.referer', $this->request->here());
			return $this->redirect($controller, $route);
		}
	}
575204
public function beforeRender(Controller $controller) {
		$configs = Cache::configured();
		$content = array();

		if (method_exists('Cache', 'getLogs')) {
			$content['stats'] = Cache::getLogs();
		}

		foreach($configs as $config)
		{
			$engine = Cache::settings($config);

			if (method_exists('Cache', 'getLogs')) {
				$logs = Cache::getLogs($config);
			} else {
				$logs['logs'] = array();
			}

			$content['cache'][$config] = array('settings' => $engine, 'logs' => $logs['logs']);
		}

		ksort($content['cache']);

		if ($this->priority > 0 && isset($content['stats'])) {
			if ($content['stats']['count'] === 0) {
				$this->title = __d('debug_kit_ex', '<b>0</b> cache');
			} else {
				$this->title = __d('debug_kit_ex', '<b>%dms / %d</b> cache', round($content['stats']['time']), $content['stats']['count']['total']);
			}
		}

		return $content;
	}
568123
private function beforeAfterController(string $when): void
    {
        if (\method_exists($this->controller, $when)) {
            \call_user_func([$this->controller, $when]);
        }
    }
126010
public function before(\Asgard\Http\Controller $controller, \Asgard\Http\Request $request) {
		if(!$controller->has('layout'))
			$controller->set('layout', null);
		if(!$controller->has('htmlLayout'))
			$controller->set('htmlLayout', null);
	}
167291
public function dispatchAction($controller)
    {
        $action = $this->matchRoute[key($this->matchRoute)]['action'] . 'Action';

        $viewModel = $controller->$action();

        if ($viewModel instanceof ViewModel) {
            $this->view->setVariables($viewModel->getVariables());
        }
    }
690855
protected function setModuleAssets($controller)
    {
        if (!$controller->isInternalRoute()) {

            $settings = $this->module->getSettings('dev');

            if (!empty($settings['status'])) {
                $controller->setJsSettings('dev', array('key' => $settings['key']));
                $controller->setJs(__DIR__ . '/js/common.js', array('position' => 'bottom'));
                $controller->setCss(__DIR__ . '/css/common.css');
            }
        }
    }
1055786
private function registerControllerFilters($controller, $controllerService, $filters)
    {
        foreach ($filters as $filter) {
            if ($filter instanceof Before) {
                foreach ($filter->methods as $method) {
                    $this->registerFilter($method, 'before', $controller, $controllerService);
                }
            }

            if ($filter instanceof After) {
                foreach ($filter->methods as $method) {
                    $this->registerFilter($method, 'after', $controller, $controllerService);
                }
            }
        }
    }
50248
public function beforeRender(Controller $controller) {
		if (!class_exists('CakeResque') || !property_exists('CakeResque', 'logs')) {
			return null;
		}

		$logs =  CakeResque::$logs;
		$count = 0;
		foreach ($logs as $l) {
			$count += count($l);
		}

		if ($this->priority > 0) {
			$this->title = __dn('debug_kit_ex', '<b>%d</b> job', '<b>%d</b> jobs', $count, $count);
		}
		return $logs;
	}
685014
public function setChange($controller=true,$method=true){
        $this->controllerChange = $controller;
        $this->methodChange = $method;
    }
116016
protected function setModuleAssets($controller)
    {
        if ($controller->path('^admin/tool/editor') && $this->module->isEnabled('codemirror')) {
            $this->getCodemirrorModule()->addLibrary($controller);
            $controller->setJs('system/modules/editor/js/common.js');
        }
    }