Create a plugin view and return it

@param   string  $layout  View layout
@param   string  $name    View name
@return  object
502823
public function view($layout='default', $name='')
	{
		$view = new View(array(
			'folder'  => $this->_type,
			'element' => $this->_name,
			'name'    => ($name   ?: $this->_name),
			'layout'  => ($layout ?: 'default')
		));
		return $view;
	}
178771
public function layout($layout, $params = [])
    {
        $this->layout = $layout;
        $this->params = $params;
        return $this;
    }
438941
public function renderPage($view, $layout = null)
    {
        $event = new PageMenuContextualEvent($view);

        //Set currentView and dispatch victoire.on_render_page event with this currentView
        $pageRenderEvent = new PageRenderEvent($view);
        $this->eventDispatcher->dispatch('victoire.on_render_page', $pageRenderEvent);
        $this->currentViewHelper->setCurrentView($view);

        //Build WidgetMap
        $this->widgetMapBuilder->build($view, true);

        //Populate widgets with their data
        $this->widgetDataWarmer->warm($this->entityManager, $view);

        //Dispatch contextual event regarding page type
        if (in_array($view->getType(), ['business_page', 'virtual_business_page'])) {
            //Dispatch also an event with the Business entity name
            $eventName = 'victoire_core.page_menu.contextual';
            if (!$view->getId()) {
                $eventName = 'victoire_core.business_template_menu.contextual';
                $event = new PageMenuContextualEvent($view->getTemplate());
            }
            $this->eventDispatcher->dispatch($eventName, $event);
            $type = $view->getBusinessEntityId();
        } else {
            $type = $view->getType();
        }

        $eventName = 'victoire_core.'.$type.'_menu.contextual';
        $this->eventDispatcher->dispatch($eventName, $event);

        if (null === $layout) {
            //Determine which layout to use
            $layout = $this->guessBestLayoutForView($view);
        }
        $globalConfig = $this->entityManager->getRepository(GlobalConfig::class)->findLast() ?: new GlobalConfig();

        //Create the response
        $response = $this->container->get('templating')->renderResponse('VictoireCoreBundle:Layout:'.$layout.'.html.twig', [
            'globalConfig'                    => $globalConfig,
            'victoire_i18n_available_locales' => $this->availableLocales,
            'victoire_twig_responsive'        => $this->twigResponsive,
            'view'                            => $view,
        ]);

        return $response;
    }
821819
public function getView($name)
    {
        if (!$this->hasView($name)) {
            throw SchemaException::schemaViewDoesNotExist($this->getName(), $name);
        }

        return $this->views[$name];
    }
646612
public function renderSelf($layout = null, $title = null)
    {
        return $this->getController()->customise([
            'TitleText' => $title
        ])->renderWith(parent::class);
    }
1308949
public function setLayout(\Haven\CmsBundle\Entity\Layout $layout = null)
    {
        $this->layout = $layout;
    
        return $this;
    }
1139778
public function viewMake($layout, $data = array())
    {
        $data = $this->setBodyAttributes($layout, $data);

        return view($layout, $data);
    }
1067175
public function getTranslatedLayout($layout)
    {
        $template = $this->layoutLoader->load($layout);
        $template = TranslationUtil::translateLayout($template, $this->getTemplater()->getLocale(), $this->translator);

        if (!$template instanceof TwigLayout) {
            $msg = 'The "%s" layout is not a twig layout';

            throw new InvalidArgumentException(sprintf($msg, $layout));
        }

        return $template;
    }
825003
private function createContentWithLayout($layout, $fragment)
    {
        // Create and append $fragment variable to the shared view stack
        $this->variables[self::TEMPLATE_PARAM_FRAGMENT_VAR_NAME] = $this->createFileContent($fragment);

        return $this->createFileContent($layout);
    }
285812
public function viewContent($layout, $data = array())
    {
        $data = $this->setBodyAttributes($layout, $data);

        return $this->layout->content = view($layout, $data);
    }
140613
public function findComponentByName($name)
    {
        if (isset($this->page->components[$name])) {
            return $this->page->components[$name];
        }

        if (isset($this->layout->components[$name])) {
            return $this->layout->components[$name];
        }

        $partialComponent = $this->partialStack->getComponent($name);
        if ($partialComponent !== null) {
            return $partialComponent;
        }

        return null;
    }
996736
public function createView(string $name, string $query): View {
		$newView = new CommonView($name, $query);
		$this->database->addMetaEntity($newView);
		return $newView;
	}
856957
public static function add(Layout $arLayout, $name)
    {
        $db = Loader::db();
        $db->Execute(
            'insert into AreaLayoutPresets (arLayoutID, arLayoutPresetName) values (?, ?)',
            array(
                $arLayout->getAreaLayoutID(),
                $name,
            )
        );

        return static::getByID($db->Insert_ID());
    }
996069
public function renderLayout($content, $layout = null)
    {
        $html = parent::renderLayout($content, $layout);

        return $this->shortcodes($html);
    }
212728
public function renderContent($layout = null, $title = null)
    {
        if ($this->hasSourceComponent()) {
            return $this->SourceComponent()->renderContent($layout, $title);
        }
        
        return parent::renderContent($layout, $title);
    }
1204096
public function renderView($viewPath = null, $data = [], $layout = null)
    {
        $renderedView = $this->view->renderView($viewPath, $data, $layout);
        return $renderedView;
    }
893693
public function getView(Layout $layout)
    {
        $identifier = $layout->getTemplateFile();

        if (null === $this->view[$identifier]) {
            $this->view[$identifier] = $this->getViewInstance($layout);
        }

        return clone $this->view[$identifier];
    }