bindIlluminateView

@param  Container  $app
@param  array      $viewPaths
@param  string     $cachePath
@return Container
962975
public function bindIlluminateView(Container $app = null, array $viewPaths = array(), $cachePath)
    {
        if (! $app) {
            $app = new Container();
        }

        $this->ensureIlluminateBase($app);

        $app->bindShared('view.engine.resolver', function (Container $app) {
            $resolver = new EngineResolver;

            $resolver->register('php', function () {
                return new PhpEngine;
            });

            $app->bindShared('blade.compiler', function (Container $app) {
                $cache = $this->illuminateCachePath;

                return new BladeCompiler($app['files'], $cache);
            });

            $resolver->register('blade', function () use ($app) {
                return new CompilerEngine($app['blade.compiler'], $app['files']);
            });

            return $resolver;
        });

        $app->bindShared('view.finder', function (Container $app) {
            $paths = $this->illuminateViewPaths;

            return new FileViewFinder($app['files'], $paths);
        });

        $app->bindShared('view', function (Container $app) {
            $env = new ViewFactory($app['view.engine.resolver'], $app['view.finder'], $app['events']);

            $env->setContainer($app);

            return $env;
        });

        return $app;
    }
72483
public function init(string $templatesPath, string $cachePath = null) : TemplateLoaderInterface
    {
        $loader = new \Twig_Loader_Filesystem($templatesPath);
        if (null !== $cachePath) {
            $this->env = new \Twig_Environment($loader, [
                'cache' => $cachePath,
            ]);
        } else {
            $this->env = new \Twig_Environment($loader);
        }
        return $this;
    }
54310
public function render($viewPath, array $params = [])
    {
        ob_start();
        ob_implicit_flush(false);
        $this->params = $params;
        extract(array_merge($params, $this->getBlocks()), EXTR_OVERWRITE);
        require(file_exists($viewPath) ? $viewPath : '../'.$viewPath);

        return ob_get_clean();
    }
636999
public function get(ContextInterface $context, string $path): ViewInterface
    {
        if (!$this->has($context, $path)) {
            throw new CacheException("No cache is available for {$path}.");
        }

        return $this->cache[$context->getID()][$path];
    }
302627
public function register(Container $app)
    {
        // old session
        $app[Session::class] = $app->make(Session::class);

        // old config
        $app[Config::class] = $app->one(Config::class);

        // old text system
        $app[Text::class] = $app->once(function (Config $config) use ($app) {
            $args = [];
            if ($config->configExists('main', 'language_text')) {
                $args[] = $config->config('language_text');
            }
            return $app->make(Text::class, $args);
        });

        // Old database system
        $app[Database::class] = $app->one(Database::class);

        // Default style renderer
        $app[RendererInterface::class] = $app->one(Page::class);

        // Global Data
        $app[GlobalData::class] = new GlobalData($app);
    }
584133
private function setViewPath()
    {
        $viewPath = (strpos($this->getTwigViewPath(), '.') == true) ?
            str_replace('.', DS, $this->getTwigViewPath()) :
            $this->getTwigViewPath();

        $this->setTemplateLocation($this->container->get('app.path').DS.$viewPath.DS);
    }
556176
protected function loadViewsFrom($path, $namespace)
    {
        if (is_dir($appPath = resource_path('views/vendor/' . $namespace))) {
            $this->container['view']->addNamespace($namespace, $appPath);
        }

        $this->container['view']->addNamespace($namespace, $path);
    }
497242
public function setCachePath($cachePath)
    {
        if (!is_dir($cachePath)) {
            throw new Exception\CachePathNotFoundException(sprintf('Cache Path, %s does not exists', $cachePath));
        }
        $this->cachePath = $cachePath;

        return $this;
    }
1228917
private CmsContainerPageBean generateContainerPageForContainers(
        Collection<CmsContainer> containers,
        String containerpageRootPath)
    throws CmsException {

        List<CmsContainerBean> containerBeans = new ArrayList<CmsContainerBean>();
        for (CmsContainer container : containers) {
            CmsContainerBean containerBean = getContainerBeanToSave(container, containerpageRootPath);
            containerBeans.add(containerBean);
        }
        CmsContainerPageBean page = new CmsContainerPageBean(containerBeans);
        return page;
    }
673866
public function register(Container $app): void
    {
        $app['markdown'] = function () {
            return Parsedown::instance();
        };

        $partialsCollection = new Collection();
        $app['partials'] = $partialsCollection;

        /** @var Partial[] $partials */
        $partials = []; //$config->getPartials();
        if ($partials) {
            foreach ($partials as $partial) {
                if (! $partial->getName()) {
                    throw new MissingNameForPartialException('The name of the partial to load is missing');
                }

                $partial->setParser($app['markdown']);
                if (!$partial->getContent() && $partial->getLink()) {
                    if (! is_readable($partial->getLink())) {
                        $app['monolog']->error(
                            sprintf('Partial "%s" not readable or found.', $partial->getLink())
                        );
                        continue;
                    }
                }

                $partialsCollection->set($partial->getName(), $partial);
            }
        }
    }
1169878
protected function loadViewsFrom($path, $namespace)
    {
        if (is_array($this->app->config['view']['paths'])) {
            foreach ($this->app->config['view']['paths'] as $viewPath) {
                if (is_dir($appPath = $viewPath.'/vendor/'.$namespace)) {
                    $this->app['view']->addNamespace($namespace, $appPath);
                }
            }
        }

        $this->app['view']->addNamespace($namespace, $path);
    }
269293
public function configure(Container $app): Pointcut
    {
        $interceptor = new CacheEvictInterceptor;
        $interceptor->setCache($app['Illuminate\Contracts\Cache\Factory']);
        $this->setInterceptor($interceptor);

        return $this->withAnnotatedAnyInterceptor();
    }
29817
protected function getIlluminateConfig(Container $app)
    {
        $files = array();

        foreach (Finder::create()->files()->name('*.php')->in($app['path.config']) as $file) {
            $files[basename($file->getRealPath(), '.php')] = $file->getRealPath();
        }

        return $files;
    }
496031
protected function rebindProviderContainer($app, $provider)
    {
        $closure = function () use ($app) {
            $this->app = $app;
        };

        $resetProvider = $closure->bindTo($provider, $provider);
        $resetProvider();
    }
832635
protected function render($viewPath, array $params = [])
    {
        if (!isset($params['title'])) {
            $params['title'] = $this->title;
        }
        $views = \pwf\basic\Application::$instance->getConfigParam('views');

        return $this->getView()->render($views.$viewPath, $params);
    }
1095613
public function render($path, $templateName, array $datas)
    {
        $viewRenderer = clone $this->viewRenderer;
        foreach ($datas as $name => $data) {
            $viewRenderer->$name = $data;
        }

        return $viewRenderer->render($path, $templateName);
    }
28338
protected function renderView($viewPath, $params, $viewsDir = null)
    {
        $view = $this->getView();

        if ($viewsDir !== null) {
            $view = clone $view;
            $view->setViewsDir($viewsDir);
        }

        if (!$view->getViewsDir()) {
            throw new \RuntimeException('Please set config property "viewsDir"');
        }

        return $view->render($viewPath, $params);
    }