private function registerModelsAndTwigLayoutNamespaces ($baseDir)
    {
        $elementTypesModel = new ElementTypesModel($baseDir);

        // model
        $this["model.element_types"] = $elementTypesModel;
        $this["model.download"]      = new DownloadModel($baseDir);

        // twig template namespaces
        foreach ($elementTypesModel->getAllElementTypes() as $elementType)
        {
            $this["twig.loader.filesystem"]->addPath($elementTypesModel->getUserSubDirectory("{$elementType}s"), $elementType);
        }


        $this["twig.loader.filesystem"]->addPath($elementTypesModel->getUserSubDirectory("_base"), "base");
    }
private function registerModelsAndTwigLayoutNamespaces ($baseDir)
    {
        $elementTypesModel = new ElementTypesModel($baseDir);

        // model
        $this["model.element_types"] = $elementTypesModel;
        $this["model.download"]      = new DownloadModel($baseDir);

        // twig template namespaces
        foreach ($elementTypesModel->getAllElementTypes() as $elementType)
        {
            $this["twig.loader.filesystem"]->addPath($elementTypesModel->getUserSubDirectory("{$elementType}s"), $elementType);
        }


        $this["twig.loader.filesystem"]->addPath($elementTypesModel->getUserSubDirectory("_base"), "base");
    }
private function registerModelsAndTwigLayoutNamespaces ( $ baseDir ) { $ elementTypesModel = new ElementTypesModel ( $ baseDir ) ; // model $ this [ "model.element_types" ] = $ elementTypesModel ; $ this [ "model.download" ] = new DownloadModel ( $ baseDir ) ; // twig template namespaces foreach ( $ elementTypesModel -> getAllElementTypes ( ) as $ elementType ) { $ this [ "twig.loader.filesystem" ] -> addPath ( $ elementTypesModel -> getUserSubDirectory ( "{$elementType}s" ) , $ elementType ) ; } $ this [ "twig.loader.filesystem" ] -> addPath ( $ elementTypesModel -> getUserSubDirectory ( "_base" ) , "base" ) ; }
Registers all models and all twig layout namespaces

@param string $baseDir
Registers all models and all twig layout namespaces