Configures the controller generator

@param Controller $controller
556099
protected function configureController(Controller $controller)
    {
        parent::configureController($controller);
        $controller[] = new Entity($this->entityName);
    }
348966
public function setControllerData($controller)
    {
        if (is_string($controller)) {
            $controller = $this->app->normalizeClassName($controller, 'Data');
        } elseif (!$controller instanceof Controller_Data) {
            throw $this->exception('Inappropriate Controller. Must extend Controller_Data');
        }
        $this->controller = $this->setController($controller);

        return $this->controller;
    }
190174
protected function generateController()
    {
        $name = Pluralizer::plural($this->model);

        $this->call(
            'generate:controller',
            array(
                'name' => "{$name}Controller",
                '--template' => $this->getControllerTemplatePath()
            )
        );
    }
1162837
public function loadController($controller)
    {
        if (!isset($this->_loadedControllers[$controller])) {
            $controllers = static::controllers();
            if (isset($controllers[$controller])) {
                $className = $controllers[$controller];
                $tagName = $controller;
            } else {
                $className = $this->getNamespace() . '\\controllers\\' . NamesHelper::urlToClass($controller) . 'Controller';
            }
            if (class_exists($className)) {
                $instance = new $className([], $this);
                $instance->setTagName($controller);
                $this->_loadedControllers[$controller] = $instance;
            }
        }
        return $this->_loadedControllers[$controller];
    }
1050550
protected function _setConfigVar(Controller &$controller) {
		$additionalCssFiles = $this->_modelConfigTheme->getListCssFiles();
		$additionalJsFiles = $this->_modelConfigTheme->getListJsFiles();
		$controller->set(compact('additionalCssFiles', 'additionalJsFiles'));
	}
550761
static public function build_plan($controller) {

        $plan = $controller->get_plan();

        // Add the root task, responsible for
        // preparing everything, creating the
        // needed structures (users, roles),
        // preloading information to temp table
        // and other init tasks
        $plan->add_task(new restore_root_task('root_task'));
        $controller->get_progress()->progress();

        switch ($controller->get_type()) {
            case backup::TYPE_1ACTIVITY:
                self::build_activity_plan($controller, key($controller->get_info()->activities));
                break;
            case backup::TYPE_1SECTION:
                self::build_section_plan($controller, key($controller->get_info()->sections));
                break;
            case backup::TYPE_1COURSE:
                self::build_course_plan($controller, $controller->get_courseid());
                break;
        }

        // Add the final task, responsible for closing
        // all the pending bits (remapings, inter-links
        // conversion...)
        // and perform other various final actions.
        $plan->add_task(new restore_final_task('final_task'));
        $controller->get_progress()->progress();
    }
856137
protected function makeController($controller)
	{
		Controller::setRouter($this->router);

		return $this->container->make($controller);
	}
662872
public function generate($controller)
    {
        $generator = new Generator(
            $this->setting->getControllerDirectory(),
            $controller
        );

        if ($generator->fileExists()) {
            echo "\033[0;31mThe controller already exists.\033[00m\n";

            exit(1);
        }

        if ($this->arg->options('--no-plain')) {
            $generator->write('controller/no-plain', [
                'baseNamespace' => $this->namespaces['controller']
            ]);
        } else {
            $generator->write('controller/controller', [
                'baseNamespace' => $this->namespaces['controller']
            ]);
        }

        echo "\033[0;32mThe controller was well created.\033[00m\n";

        exit(0);
    }
93047
public function setController($controller) {
        $controller = Str::studly($controller);
        if('Controller' != substr($controller, -10)) {
            $controller = $controller . 'Controller';
        }

        $this->controller = $controller;

        return $this;
    }
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);
        }
    }
1369435
protected function createController($controller)
    {
        if (false === strpos($controller, '::')) {
            throw new \InvalidArgumentException(sprintf('Unable to find controller "%s".', $controller));
        }

        list($class, $method) = explode('::', $controller, 2);

        if (!class_exists($class)) {
            throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
        }

        return array(new $class(), $method);
    }
191397
private function createResourceController(
        Generator $generator,
        $prefix,
        $controller,
        $model_namespace = ''
    ) {
        $generator->write('controller/rest', [
            'modelNamespace' => $model_namespace,
            'prefix' => $prefix,
            'baseNamespace' => $this->namespaces['controller']
        ]);

        echo Color::green('The controller Rest was well created.');
    }
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);
            }
        }
    }
523884
public function startup(Controller $controller) {
		if (!$this->_controller->ViewExtension->isHtml()) {
			return;
		}

		$this->_setConfigVar($controller);
	}
898083
public function setController(Controller $controller)
    {
        $this->_Controller = $controller;
        $this->setEventManager($controller->getEventManager());
    }
1130222
private void injectController(AppController controller) {
        Injector injector = Configuration.getInjector();
        if (injector != null) {
            injector.injectMembers(controller);
        }
    }
1116674
protected function switchTheme(Controller $controller)
    {
        if (!$controller->isInternalRoute()) {

            try {

                $device = $this->getDeviceType();
                $store_id = $controller->getStoreId();
                $settings = $this->module->getSettings('device');

                if (!$controller->isBackend() && $device !== 'desktop' && !empty($settings['theme'][$store_id][$device])) {
                    $theme = $settings['theme'][$store_id][$device];
                    if ($this->module->isEnabled($theme)) {
                        $controller->setCurrentTheme($theme);
                    }
                }

            } catch (Exception $ex) {
                trigger_error($ex->getMessage());
            }
        }
    }