getSite

@param PhpRenderer $view

@return Site
978301
public function getSite(
        PhpRenderer $view
    ) {
        /** @var \Rcm\Entity\Site $site */
        $site = $view->site;

        /** Fix for non CMS pages */
        if (empty($site)) {
            $site = $this->currentSite;
        }

        return $site;
    }
1305777
public function render($view)
    {
        if (!$this->context() && strpos($view, '/') !== false) {
            $this->context(dirname($view));
        }
        $content = $this->viewContent($this->type(), DIRECTORY_SEPARATOR . $view);
        if ($this->layout) {
            $ext = pathinfo($this->layout, PATHINFO_EXTENSION);
            $this->layout = ($ext === '') ? $this->layout.'.php' : $this->layout;
            $this->set('content', $content);
            $content = $this->viewContent(self::VIEW_TYPE_LAYOUT, $this->layout);
        }
        return $content;
    }
749056
public function render($view)
    {
        if (method_exists($this, 'beforeRender')) {
            $this->beforeRender();
        }

        if (method_exists($this, 'getContext')) {
            $contextClass = $this->getContext();
            $context = new $contextClass($view, $this->data);
            $template = $this->path() . DS . 'out.mustache';
        } else {
            $template = $this->path() . DS . 'out.ctp';
        }

        if (!file_exists($template)) {
            user_error(__d('wasabi_cms', 'Template "{0}" for module {1} not found.', $template, $this->name()));
        }

        if (isset($context)) {
            if (!$this->_mustache) {
                $this->_mustache = new \Mustache_Engine();
            }
            $output = $this->_mustache->render(file_get_contents($template), $context);
        } else {
            $output = $view->element('Wasabi/Cms.module', [
                'template' => $template,
                'data' => $this->data
            ]);
        }

        return $output;
    }
1048343
protected function generateView($view, $data = [])
    {
        if(is_null($this->viewPath)) {
            return $view;
        }

        $twig = new Twig_Environment(
            new Twig_Loader_Filesystem(realpath($this->viewPath))
        );

        return $twig->render($view, $data);
    }
681522
public function render($view = null)
    {
        if (is_null($view) and ! isset($this->templatePaths[$this->defaultLanguage])) {
            return '';
        }
        $return   = (is_null($view)) ? view($this->templatePaths[$this->defaultLanguage], $this->predefinedVariables) : view($view, $this->predefinedVariables);
        $adapter  = app(VariablesAdapter::class);
        $rendered = $adapter->fill($return->__toString());
        preg_match_all('/\[\[(.*?)\]\]/', $rendered, $matches);
        if (isset($matches[0]) && isset($matches[1])) {
            foreach ($matches[0] as $index => $variable) {
                $rendered = str_replace($variable, '{{ ' . $matches[1][$index] . ' }}', $rendered);
            }
            $twig = new Twig_Environment(new Twig_Loader_String());
            return $twig->render($rendered, $this->predefinedVariables);
        }

        return $rendered;
    }
124862
public function render(string $view): string
	{
		if(empty($this->viewFactory))
		{
			throw new RuntimeException('A [ ViewFactory ] instance is required to render pagination views.');
		}

		return $this->viewFactory->create($view, $this->pagination())->render();
	}
1241468
protected function view_path( $view )
	{
		if ( isset( static::$_view_paths[$view] ) )
		{
			return static::$_view_paths[$view];
		}
		
		// view is empty?
		if ( is_null( $view ) )
		{
			throw new CCException( "CCView - cannot render view without a view file." );
		}
		
		// generate the views path
		$path = CCPath::get( $view, CCDIR_VIEW, EXT );
		
		if ( !file_exists( $path ) ) 
		{
			throw new CCException( "CCView - could not find view: ".$view." at: {$path}." );
		}
		
		// does the view implement a view builder?
		if ( strpos( $view, '.' ) !== false )
		{
			$cache = static::cache_path( $view );
			
			// does the cache not exits or is out of date
			if ( !file_exists( $cache ) || filemtime( $cache ) < filemtime( $path ) )
			{
				list( $view_name, $builder ) = explode( '.', $view );
				$this->build_cache( $cache, $builder, $path );
			}
			
			$path = $cache;
		}
		
		return static::$_view_paths[$view] = $path;
	}
55973
private static function defaultRenderer($view, $parmas = array(), $sharedData = array()) {
        $file = self::findFile($view);

        ob_start();
        ob_implicit_flush(false);

        if ($parmas) {
            extract($parmas, EXTR_OVERWRITE);
        }

        if ($sharedData) {
            extract($sharedData, EXTR_OVERWRITE);
        }

        require $file;

        return ob_get_clean();
    }
910001
public function getViewPath($view)
    {
        if ($this->finder) {
            if (file_exists($file = $this->finder->find($view))) {
                return $file;
            }
        }

        if (file_exists($view)) {
            return $view;
        } elseif (file_exists($view . '.' . $this->extension)) {
            return $view . '.' . $this->extension;
        }

        foreach ($this->viewPaths as $viewPath) {
            if (file_exists($viewPath . '/' . $view . '.' . $this->extension)) {
                return $viewPath . '/' . $view . '.' . $this->extension;
            }
        }

        return null;
    }
261446
public function getView(View $view)
    {
        if (!$view instanceof BlockValueView) {
            return null;
        }

        $block = $view->getBlock();

        $legacyKernel = $this->getLegacyKernel();
        $legacyBlockClosure = static function (array $params) use ($block, $legacyKernel) {
            return $legacyKernel->runCallback(
                static function () use ($block, $params) {
                    $tpl = eZTemplate::factory();
                    /**
                     * @var \eZObjectForwarder
                     */
                    $funcObject = $tpl->fetchFunctionObject('block_view_gui');
                    if (!$funcObject) {
                        return '';
                    }

                    $children = [];
                    $funcObject->process(
                        $tpl, $children, 'block_view_gui', false,
                        [
                            'block' => [
                                [
                                    eZTemplate::TYPE_ARRAY,
                                    // eZTemplate::TYPE_OBJECT does not exist because
                                    // it's not possible to create "inline" objects in
                                    // legacy template engine (ie objects are always
                                    // stored in a tpl variable).
                                    // TYPE_ARRAY is used here to allow to directly
                                    // retrieve the object without creating a variable.
                                    // (TYPE_STRING, TYPE_BOOLEAN, ... have the same
                                    // behaviour, see eZTemplate::elementValue())
                                    new BlockAdapter($block),
                                ],
                            ],
                        ],
                        [], '', ''
                    );
                    if (\is_array($children) && isset($children[0])) {
                        return ezpEvent::getInstance()->filter('response/output', $children[0]);
                    }

                    return '';
                },
                false
            );
        };

        return new ContentView($legacyBlockClosure);
    }
1295900
private function deriveView($view)
    {
        // Check if the view already exists as specified
        if(self::exists($view))
        {
            // It does so just return it
            return $view;
        }

        // Check if there are any namespaces yet
        if($this->namespaces === NULL)
        {
            // There aren't so grab the namespace information from the configuration file
            $this->namespaces = config('layout-view.namespaces');
        }

        // Check if the selected layout has been set
        if($this->selected_layout === NULL)
        {
            // It hasn't been, so set it based on the config values
            $this->selected_layout = config('layout-view.layout.selected');
        }

        // Check if the fallback layout has been set
        if($this->fallback_layout === NULL)
        {
            // It hasn't been, so set it based on the config values
            $this->fallback_layout = config('layout-view.layout.fallback');
        }

        // The view that will be rendered
        $target = NULL;

        // Cycle through all of the namespaces
        foreach($this->namespaces as $namespace)
        {
            // Does the namespace have the colons in it?
            if($namespace != '' && stripos($namespace, '::') === FALSE)
            {
                // Didn't exist, so append it
                $namespace .= '::';
            }

            // Derive the base view
            $derived = $namespace . (is_null($this->selected_layout) ? '' :  $this->selected_layout . '.') . $view;

            // Look to see if the view exists
            if(self::exists($derived))
            {
                // It does, so render it
                $target = $derived;
            }
            else
            {
                // It didn't so try in the fallback
                $derived = $namespace . (is_null($this->fallback_layout) ? '' : $this->fallback_layout .  '.') . $view;

                // Check if the fallback view exists
                if(self::exists($derived))
                {
                    $target = $derived;
                }
            }

            // Check if we found a match
            if($target !== NULL)
            {
                // We did, so no sense looping
                break;
            }
        }

        // Return the name of the view we found.
        return $target === NULL ? $view : $target;
    }
656588
public function views(ViewCollector $view)
    {
        $view->handle('install.page.{content?}', function($content) {
            return realpath(__DIR__ . '/../views/' . $content . '.php');
        })
        ->where('content', 'welcome|finish|requirements|account|database|timezone|install')
        ->implicit('content', 'page');

        $view->handle('install.jumbotron', function() {
            return realpath(__DIR__ . '/../views/jumbotron.php');
        });
    }
1143899
public function render(string $view = '', array $variables = []): string
    {
        if (!empty($view)) {
            $this->setView($view);
        }
        $this->assign($variables);
        $content = $this->renderView();
        if (empty($this->layout)) {
            return $content;
        }
        return $this->renderLayout($content);
    }
765381
protected function _getFormView($view = null)
    {
        if (empty($view) && Arr::in($this->request->getParam('action'), $this->_formActions)) {
            $view = $this->_findViewByRequest();
        }

        return $view;
    }
193243
public function viewNgLandingPage(ContentView $view)
    {
        $location = $view->getSiteLocation();
        if (!$location instanceof Location) {
            $location = $view->getSiteContent()->mainLocation;
        }

        $response = $this->checkCategoryRedirect($location);
        if ($response instanceof Response) {
            return $response;
        }

        return $view;
    }
610617
public function find($view)
    {
        $view = str_replace('.', DIRECTORY_SEPARATOR, $view) . '.php';

        foreach ($this->locations as $location)
        {
            if (is_file($path = $location.'/'.$view)) {
                return $path;
            }
        }

        return false;
    }
350942
public function getViewReferenceBuilder(View $view)
    {
        if (array_key_exists($viewClass = ClassUtils::getClass($view), $this->viewsReferenceBuilders)) {
            return $this->viewsReferenceBuilders[$viewClass];
        }

        throw new ServiceNotFoundException('No view reference builder found for '.$viewClass);
    }