Boot up Twig template engine
@param  Array $config
774658
public function bootTwig($config){
        $app    = $this->app;
        $view   = $app->view;

        $view->parserOptions = $config;
        $view->parserExtensions = array(
            new \Slim\Views\TwigExtension(),
            new \SlimStarter\TwigExtension\MenuRenderer()
        );
    }
493024
private function init($config = array())
    {
        $this->getCore()->open($this->getFilename(), $config);
        if ($this->currentSheet !== null) {
            $this->getCore()->setSheet($this->currentSheet);
        }
    }
1074321
public static function boot(array $config)
    {
        if (self::$booted) {
            return;
        }
        
        /**
         * Loader.
         */
        if (!isset($config['loader'])) {
            throw new BadMethodCallException(
                'Requires at least loader instance or configuration'
            );
        } else {
            if (is_array($config['loader'])) {
                // require_once __DIR__ . '/Rails/Loader/Loader.php';
                $loader = new Rails\Loader\Loader();
                
                if (isset($config['loader']['paths'])) {
                    $loader->addPaths($config['loader']['paths']);
                }
                
                if (isset($config['loader']['composerAutoloader'])) {
                    $loader->setComposerAutoloader(
                        $config['loader']['composerAutoloader']
                    );
                } else {
                    $loader->addPath(__DIR__ . '/Rails');
                }
                $loader->register();
            } elseif ($config['loader'] instanceof Rails\Loader\Loader) {
                $loader = $config['loader'];
            } else {
                throw new InvalidArgumentException(
                    sprintf(
                        'Loader must be either array or instance of Rails\Loader\Loader, %s passed',
                        gettype($config['loader'])
                    )
                );
            }
        }
        
        /**
         * Service Manager.
         */
        $sm = new Zend\ServiceManager\ServiceManager();
        self::$serviceManager = $sm;
        $sm->setService('loader', $loader);
        
        /**
         * Global configuration.
         */
        $sm->setService('rails.config', new Rails\ActiveSupport\ArrayObject([
            'use_cache' => false
        ]));
        
        /**
         * Inflector.
         */
        $sm->setFactory('inflector', function() {
            return new Rails\ActiveSupport\Inflector\Inflector(
                new Rails\ActiveSupport\Inflector\Inflections\EnglishInflections,
                'en'
            );
        });
        
        /**
         * Translator.
         */
        $sm->setFactory('i18n', function() {
            $tr = new Rails\I18n\LoadingTranslator();
            $tr->setDefaultLocale('en');
            $tr->setLoader(new Rails\I18n\Loader());
            
            
            # Add Rails' locales paths to i18n loader
            $tr->loader()->addPaths([
                __DIR__ . '/Rails/ActiveSupport/Carbon/locales',
                __DIR__ . '/Rails/I18n/locales',
            ]);
            
            return $tr;
        });
        
        self::$booted = true;
    }
1137129
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setController($this->_registry->getController());

        $this->_registerFromConfigure();
    }
298201
public function initialize(array $config = [])
    {
        if (empty($this->engine)) {
            if ($this->isSupported()) {
                $this->engine = new \Mustache_Engine();
            } else {
                throw new RuntimeException(
                    'PARSER_E_THIRD_PARTY',
                    0,
                    ['Mustache Template Engine by Justin Hileman', 'https://github.com/bobthecow']
                );
            }
        }

        return $this;
    }
1110482
public function load(array $config)
    {
        $config = $this->getParsedConfig(
            $config,
            $this->config,
            $this->yamlConfigMap,
            $this->required
        );
        $this->setParsedConfig($config);

        return $this;
    }
197528
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->dir     = Configure::read('Cms.docDir');
        $this->locale  = Configure::read('App.defaultLocale');
        $this->charset = Str::low(Configure::read('App.encoding'));
        $this->eol     = (Configure::read('debug')) ? PHP_EOL : '';
        $this->tab     = (Configure::read('debug')) ? Configure::read('Cms.lineTab') : '';
    }
77116
public function initialize(array $config)
    {
        $this->setController($this->_registry->getController());

        $this->_registerPostTypesFromConfigure();

        $this->_addMenuItems();
    }
310205
public function load(array $config, ContainerBuilder $container)
    {
        $loader = new YamlFileLoader(
            $container,
            new FileLocator(__DIR__ . '/../Resources/config')
        );

        // Base services override
        $loader->load('services.yml');
    }
1271767
public function load(array $config)
    {
        foreach ($config as $id => $classname) {
            $serviceId = $this->generateBundleServiceId($id);

            if (false === $this->container->hasDefinition($serviceId)) {
                $baseDir = $this->buildBundleBaseDirectoryFromClassname($classname);
                $this->bundlesBaseDir[$serviceId] = $baseDir;
                $this->container->setDefinition(
                    $serviceId,
                    $this->buildBundleDefinition($classname, $id, $baseDir)
                );

                $this->bundleInfos[$id] = [
                    'main_class' => $classname,
                    'base_dir'   => $baseDir,
                ];
            }
        }

        if (0 < count($this->bundlesBaseDir)) {
            $this->loadFullBundles();
        }
    }
877268
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->addBehavior('Qobo/Utils.Footprint');

        $config = (new ModuleConfig(
            ConfigType::MODULE(),
            App::shortName($config['className'], 'Model/Table', 'Table')
        ))->parseToArray();

        // Set trash behavior
        if (!isset($config['table']['trash']) || $config['table']['trash'] === true) {
            $this->addBehavior('Muffin/Trash.Trash');
        }

        // set display field from config
        if (isset($config['table']['display_field'])) {
            $this->setDisplayField($config['table']['display_field']);
        }

        $this->setAssociations();
    }
131933
public function initialize(array $config)
    {
        parent::initialize($config);

        $_config = [
            'context'  => __d('core', 'record'),
            'redirect' => [
                'action'     => 'index',
                'prefix'     => $this->_request->getParam('prefix'),
                'plugin'     => $this->_request->getParam('plugin'),
                'controller' => $this->_request->getParam('controller'),
            ],
            'messages' => [
                'no_action' => __d('core', 'Action not found.'),
                'no_choose' => __d('core', 'Please choose only one item.'),
            ]
        ];

        $config = Hash::merge($_config, $config);
        $this->setConfig($config);
    }
1010632
public function load(array $config, ContainerBuilder $container)
    {
        $configs[] = $this->options;
        $configuration = $this->getConfiguration($configs, $container);
        $config = $this->processConfiguration($configuration, $configs);

        $this->configureStorage($config, $container);
        $this->configureMetadataDriver($config, $container);
        $this->configureEntityManager($config, $container);
    }
50115
public function loadConfig(array $config)
    {
        $this->devServerEnabled = $config['dev_server_enable'];
        $this->devServerHost = $config['dev_server_host'];
        $this->devServerPort = $config['dev_server_port'];
    }
753089
public static function start(&$config)
    {
        $config = array_merge(array(
        
            /* @var bool */
            'autostart' => true,

            /* @var string */
            'namespace' => false
            
        ), $config);
        self::$config = &$config;
    }
353970
public static function run(array $config) {
        static::init($config);
        static::moduleIsActivated();
        $cache = static::canCache();
        $name = join('/', static::getUrls());
        if ($cache && $out = $cache->fetch($name)) {
            echo $out;
        }
        else {
            $controller = static::getControllerClass();
            $action = static::getAction();
            if (!in_array($action, $controller->getActions())) {
                ControllerException::invalidAction($action);
            }

            $params = static::getParams();
            static::authenticate($controller, $action, $params);

            $refMethod = new ReflectionMethod($controller, $action . 'Action');

            if (count($params) < $refMethod->getNumberOfRequiredParameters()) {
                ControllerException::invalidParamCount();
            }
            $actionRet = call_user_func_array(array($controller, $action . 'Action'), $params);

            if (!is_array($actionRet)) {
                ControllerException::invalidActionResult();
            }
            static::terminate();
            
            header('Content-Type: application/json');
            die(json_encode($actionRet));
        }
    }
1079997
public function initialize(array $config = [])
    {
        if (count($config)) {
            $this->setConfig($config);
        } elseif (false !== ($config = config('view')->presenter)) {
            $this->setConfig($config);
        }

        // autoload presenter assets
        if (isset($config[ 'assets' ])) {
            $this->assets->autoload($config[ 'assets' ]);
        }

        // autoload presenter theme
        if(isset($config['theme'])) {
            $this->setTheme($config['theme']);
        }

        return $this;
    }