Initialize component

@param Controller $controller Instantiating controller
@return void
510642
public function initialize(Controller $controller) {
		$this->_controller = $controller;
		if (!$this->_controller->Components->loaded('RequestHandler')) {
			$this->_controller->RequestHandler = $this->_controller->Components->load('RequestHandler');
			$this->_controller->RequestHandler->initialize($this->_controller);
		}
		if (!$this->_controller->Components->loaded('CakeTheme.ViewExtension')) {
			$this->_controller->ViewExtension = $this->_controller->Components->load('CakeTheme.ViewExtension');
			$this->_controller->ViewExtension->initialize($this->_controller);
		}
	}
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);
	}
1061037
public function initializeComponents(Grid $grid)
    {
        foreach ($this->getComponents() as $component) {
            $component->initialize($grid);
        }
    }
1001953
public function initialize(Controller $controller) {
		$this->_controller = $controller;
		$isAppInstalled = $this->isAppInstalled();
		if (($this->_controller->request->param('plugin') !== 'cake_installer') ||
			($this->_controller->request->param('controller') !== 'check') ||
			($this->_controller->request->param('action') !== 'index')) {
			if (!$isAppInstalled) {
				$urlRedirect = ['controller' => 'check', 'action' => 'index', 'plugin' => 'cake_installer'];
				$this->_controller->redirect($urlRedirect);
			}
		}
	}
1289462
protected function setModuleAssets(Controller $controller)
    {
        $controller->addAssetLibrary('jquery_mobile');
        $controller->setJs(__DIR__ . '/js/common.js');
        $controller->setCss(__DIR__ . '/css/common.css');
    }
708845
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->Controller = $this->_registry->getController();

        if ($this->config('Auth')) {
            $this->Controller->loadComponent('Auth', $this->config('Auth'));
        }

        $this->Controller->loadComponent('Utils.Menu');
    }
1144860
public function initialize(Controller $controller) {
		$this->_controller = $controller;
		if (!$this->_controller->Components->loaded('RequestHandler')) {
			$this->_controller->RequestHandler = $this->_controller->Components->load('RequestHandler');
			$this->_controller->RequestHandler->initialize($this->_controller);
		}
		if (!$this->_controller->Components->loaded('Session')) {
			$this->_controller->Session = $this->_controller->Components->load('Session');
			$this->_controller->Session->initialize($this->_controller);
		}
		if ($this->_controller->Auth->loggedIn() ||
			$this->_controller->RequestHandler->prefers('json')) {
			return;
		}

		$isAuthCfg = $this->_modelSetting->isAuthGroupConfigured();
		if ($isAuthCfg) {
			if ($this->_controller->Session->read('Settings.FirstLogon')) {
				$this->_controller->Session->delete('Settings.FirstLogon');

				return $this->_controller->redirect($this->_controller->Auth->logout());
			}

			return;
		}

		$pluginName = $this->_controller->request->param('plugin');
		$controllerName = $this->_controller->request->param('controller');
		$actionName = $this->_controller->request->param('action');
		if (($pluginName !== 'cake_settings_app') ||
			($controllerName !== 'settings') ||
			($actionName !== 'index')) {
			return;
		}

		$this->_controller->Auth->allow('index');
		$this->_controller->Session->write('Settings.FirstLogon', true);
	}
1322961
public function controller($controller)
    {

        // Instantiate a string controller
        if (is_string($controller)
            && class_exists($controller)
            && is_subclass_of($controller, 'Bkwld\Decoy\Controllers\Base')) {
            $this->controller_name = $controller;
            $this->controller = new $controller;

            // Apply the parent if one was set
            if ($this->parent_item && $this->controller) {
                $this->controller->parent($this->parent_item);
            }

        // Or, validate a passed controller instance
        } elseif (is_object($controller)
            && is_a($controller, 'Bkwld\Decoy\Controllers\Base')) {
            $this->controller_name = get_class($controller);
            $this->controller = $controller;
        }

        // Chain
        return $this;
    }
556099
protected function configureController(Controller $controller)
    {
        parent::configureController($controller);
        $controller[] = new Entity($this->entityName);
    }
1050550
protected function _setConfigVar(Controller &$controller) {
		$additionalCssFiles = $this->_modelConfigTheme->getListCssFiles();
		$additionalJsFiles = $this->_modelConfigTheme->getListJsFiles();
		$controller->set(compact('additionalCssFiles', 'additionalJsFiles'));
	}
751070
protected function setControllerVars($controller)
    {
        $this->controller = $controller;

        if (is_callable($controller)) {
            $this->setControllerCallable($controller);
        } else {
            $this->usesCallable = false;
            $atCharPos = strpos($controller, '@');

            // Make sure the "@" is somewhere in the middle of the string
            if ($atCharPos === false || $atCharPos === 0 || $atCharPos === mb_strlen($controller) - 1) {
                throw new InvalidArgumentException('Controller string is not formatted correctly');
            }

            $this->controllerName = substr($controller, 0, $atCharPos);
            $this->controllerMethod = substr($controller, $atCharPos + 1);
        }
    }
574460
protected function makeController($controller)
	{
		Controller::setFilterer($this->filterer);

		return $this->container->make($controller);
	}
1218102
public void initialize(I_CmsSitemapController controller) {

        m_ownProperties = controller.replaceProperties(m_id, m_ownProperties);
        m_defaultFileProperties = controller.replaceProperties(m_defaultFileId, m_defaultFileProperties);
        controller.registerEntry(this);
    }
370509
public function initializeController(RequestInterface $request, ResponseInterface $response)
    {
        parent::initializeController($request, $response);
        $this->feedbackCollection->setControllerContext($this->getControllerContext());
    }
569770
public function setController($controller)
        {
            if (null !== $controller && !is_string($controller)) {
                throw new Exception(
                    'Invalid argument: $controller must be a string or null'
                );
            }

            $this->_controller = $controller;
            $this->_hrefCache  = null;

            return $this;
        }
761881
public function startup(Controller $controller) {
        $this->Controller = $controller;

        // Thrown an exception if accessing an override action without requestAction()
        if (substr($controller->action, 0, 6) === 'admin_' && empty($controller->request->params['override'])) {
            throw new ForbiddenException();
        }

        // Set ACL session
        $user_id = $this->Auth->user('id');

        if (!$user_id || $this->Auth->user(Configure::read('User.fieldMap.status')) == Configure::read('User.statusMap.banned')) {
            return;
        }

        if (!$this->Session->check('Acl')) {
            $roles = ClassRegistry::init('Admin.RequestObject')->getRoles($user_id);
            $isAdmin = false;
            $isSuper = false;
            $roleMap = array();

            foreach ($roles as $role) {
                if (!$isAdmin && $role['RequestObject']['alias'] == Configure::read('Admin.aliases.administrator')) {
                    $isAdmin = true;
                }

                if (!$isSuper && $role['RequestObject']['alias'] == Configure::read('Admin.aliases.superModerator')) {
                    $isSuper = true;
                }

                $roleMap[$role['RequestObject']['id']] = $role['RequestObject']['alias'];
            }

            $this->Session->write('Acl.isAdmin', $isAdmin);
            $this->Session->write('Acl.isSuper', $isSuper);
            $this->Session->write('Acl.roles', $roleMap);
        }

        // Set reported count
        if (Configure::read('Admin.menu.reports')) {
            Configure::write('Admin.menu.reports.count', Admin::introspectModel('Admin.ItemReport')->getCountByStatus());
        }
    }
1314316
public function implicitController($controller)
    {
        $container = $this->getContainer();
        $reflection = $container->getReflection()->setClass($controller);
        $methods = $reflection->getMethods('public', false, null);

        foreach ($methods as $key => $method) {
            if ($method !== '__construct') {
                list($uri, $verb, $method, $plain) = $this->getRoutesParameters($method, $controller, $reflection);
                $args = $this->getUriArguments($plain);

                if (!in_array($verb, $this->verbs)) {
                    throw new \RuntimeException("Invalid HTTP verb ($verb) exception.");
                }

                $classParam = ['controller' => $controller, 'method' => $method, 'args' => $args];

                $this->handleRoute($container, $classParam, $verb, $uri);
            }
        }
    }