render the preview image using the defined view (found in self::VIEW_PATH).

@param string $sView - the view
@param string $type  - Core, Custom-Core, Customer

@return string
770081
public function Render($sView = 'simple', $type = 'Core', $aEffects = array(), $bHideNewMarker = false)
    {
        $oView = new TViewParser();

        $oArticle = &$this->GetArticleObject();
        $oArticleSize = &$this->GetImageSizeObject();
        $oImage = &$this->GetImageObject();

        $oView->AddVar('oArticle', $oArticle);
        $oView->AddVar('oImageSize', $oArticleSize);
        $oView->AddVar('oImage', $oImage);
        $oView->AddVar('oPreviewImage', $this);
        $oView->AddVar('bHideNewMarker', $bHideNewMarker);
        $oThumb = $this->GetImageThumbnailObject($aEffects);
        $oView->AddVar('oImageThumbnail', $oThumb);

        return $oView->RenderObjectPackageView($sView, self::VIEW_PATH, $type);
    }
1209849
public function renderView()
    {
        if ($this->class) {
            $this->template->append('class', implode(' ', $this->class));
        }

        if ($this->style) {
            $style = $this->style;
            array_walk(
                $style,
                function (&$item, $key) {
                    $item = $key.':'.$item;
                }
            );
            $this->template->append('style', implode(';', $style));
        }

        if ($this->ui) {
            if (is_string($this->ui)) {
                $this->template->set('_class', $this->ui);
            }
        } else {
            $this->template->tryDel('_ui');
        }

        if ($this->id) {
            $this->template->trySet('_id', $this->id);
        }

        if ($this->element) {
            $this->template->set('_element', $this->element);
        }

        if ($this->attr) {
            $tmp = [];
            foreach ($this->attr as $attr => $val) {
                $tmp[] = $attr.'="'.$this->app->encodeAttribute($val).'"';
            }
            $this->template->setHTML('attributes', implode(' ', $tmp));
        }
    }
23590
public function index($type = null)
    {
        // setting up an event for the index
        $_event = new Event('Controller.PostTypes.beforeIndex.' . $this->_type, $this, [
        ]);
        $this->eventManager()->dispatch($_event);

        $this->paginate = [
            'limit' => 25,
            'order' => [
                ucfirst($type) . '.id' => 'asc'
            ]
        ];

        foreach ($this->Settings['filters'] as $key => $value) {
            if (is_array($value)) {
                $this->Search->addFilter($key, $value);
            } else {
                $this->Search->addFilter($value);
            }
        }

        $query = $this->Search->search($this->Model->find('all'));

        $this->set('types', $this->paginate($query));

        // setting up an event for the index
        $_event = new Event('Controller.PostTypes.afterIndex.' . $this->_type, $this, [
        ]);
        $this->eventManager()->dispatch($_event);


        if (!$this->Settings['views']['index']) {
            $this->render(Configure::read('PostTypes.AdminPostTypeViews.index'));
            return;
        }

        $this->render($this->Settings['views']['index']);
    }
1171237
protected function generateShowView(AbstractResourceBundle $bundle, &$summary)
    {
        $path = $bundle->getPath() . '/Resources/views/' . $this->model . '/show.html.twig';
        $entityClass = $this->getContainer()->get('doctrine')->getAliasNamespace($this->bundle->getName()) . '\\' . $this->model;
        $identifier = $this->getContainer()->get('doctrine')
            ->getManager()
            ->getClassMetadata($entityClass)
            ->getIdentifier();

        if (file_exists($path)) {
            $summary[] = '';
            $summary[] = '<bg=red>Show view already exist.</>';

            return;
        }

        $this->renderFile('crud/show.html.twig.twig',
            $path,
            array(
                'bundle'     => $bundle->getName(),
                'model'      => $this->model,
                'identifier' => $identifier[0],
                'prefix'     => $this->getBundlePrefix($bundle),
                'cancel'     => strtolower($this->getBundlePrefix($bundle) . '_' . $this->model . '_index'),
                'actions'    => array(
                    'edit' => strtolower($this->getBundlePrefix($bundle) . '_' . $this->model . '_update')
                )
            )
        );

        $summary[] = '';
        $summary[] = '<bg=green>Show view created.</>';
    }
1107983
public function getHtml($type = self::NO_SINGLE_RENDER_TYPE) {
        $this->_singleRenderType = $type;
        return $this->_handleDirectCall('getHtml')->toHtml();
    }
1063484
protected function renderTemplateButton($type,$page){
        $options = $this->{$type.'LiButtonOptions'};
        $linkWrapTag = ArrayHelper::remove($options, 'tag', 'li');
        Html::addCssClass($options, $this->{$type.'LiButtonCssClass'});

        $buttonOptions = $this->{$type.'ButtonOptions'};
        $buttonOptions['id']=$this->{$type.'ButtonIdHeader'}.self::${$type.'Counter'};
        return Html::tag($linkWrapTag, Html::a($this->{$type.'ButtonLabel'},$this->pagination->createUrl($page),$buttonOptions),$options);
    }
1179840
public function previewAction()
    {
        //wyłączenie layout
        $this->view->setLayoutDisabled();
        //wyszukiwanie kategorii
        if (null === $this->view->category = (new \Cms\Orm\CmsCategoryQuery)->findPk($this->categoryId)) {
            $this->getResponse()->redirect('cmsAdmin', 'category', 'tree');
        }
    }
1029857
protected function &GetAdditionalViewVariables($sViewName, $sViewType)
    {
        $aViewVariables = parent::GetAdditionalViewVariables($sViewName, $sViewType);

        $aUserData = $this->GetUserData();
        if (false == $aUserData) {
            $aUserData = null;
        }
        $aViewVariables['oUserData'] = TdbDataExtranetUser::GetNewInstance($aUserData);

        $aShippingAddress = $this->GetShippingAddressData();
        if (false == $aShippingAddress) {
            $aShippingAddress = null;
        }
        $aViewVariables['oShippingAddress'] = TdbDataExtranetUserAddress::GetNewInstance($aShippingAddress);

        $aBillingAddress = $this->GetBillingAddressData();
        if (false == $aBillingAddress) {
            $aBillingAddress = null;
        }
        $aViewVariables['oBillingAddress'] = TdbDataExtranetUserAddress::GetNewInstance($aBillingAddress);

        $aViewVariables['bShipToBillingAddress'] = $this->GetShipToBillingAddress();

        $aViewVariables['oUser'] = self::getExtranetUserProvider()->getActiveUser();

        $aViewVariables['umode'] = TShopStepUserDataV2::GetUserMode();

        return $aViewVariables;
    }
1059956
public function Render($sViewName = 'RatingServiceRating_standard', $sViewSubType = 'pkgShopRatingService/views', $sViewType = 'Customer', $sSpotName = null, $aCallTimeVars = array())
    {
        $oView = new TViewParser();

        $oRatingService = $this->GetFieldPkgShopRatingService();
        $oView->AddVar('oRating', $this);
        $oView->AddVar('oRatingService', $oRatingService);

        $oView->AddVar('fieldRatingDate', $this->fieldRatingDate);
        $sRatingText = $this->fieldRatingText;
        if (false == $oRatingService->fieldRatingsContainHtml) {
            $sRatingText = nl2br(TGlobal::OutHTML(strip_tags($sRatingText)));
        }
        $oView->AddVar('fieldRatingText', $sRatingText);

        $oView->AddVar('fieldRatingService_CurrentRating', $this->GetFieldPkgShopRatingService()->fieldCurrentRating);

        return $oView->RenderObjectPackageView($sViewName, $sViewSubType, $sViewType);
    }
562042
public static function renderErrorView(
        $sView,
        $aData = [],
        $bFlushBuffer = true
    ) {

        //  Flush the output buffer
        if ($bFlushBuffer) {
            $sObContents = ob_get_contents();
            if (!empty($sObContents)) {
                ob_clean();
            }
        }

        $oInput = Factory::service('Input');
        $sType  = $oInput::isCli() ? 'cli' : 'html';
        $aPaths = [];

        $oRouter     = Factory::service('Router');
        $sController = ucfirst($oRouter->fetch_class());

        if (class_exists($sController)) {
            $oReflection     = new \ReflectionClass($sController);
            $sModuleViewPath = preg_replace('/controllers$/', '', dirname($oReflection->getFileName()));
            $aPaths[]        = implode(DIRECTORY_SEPARATOR, [
                rtrim($sModuleViewPath, DIRECTORY_SEPARATOR),
                'views',
                'errors',
                $sType,
                $sView . '.php',
            ]);
        }

        //  App generic
        $aPaths[] = implode(DIRECTORY_SEPARATOR, [
            NAILS_APP_PATH . 'application',
            'views',
            'errors',
            $sType,
            $sView . '.php',
        ]);

        //  Nails
        $aPaths[] = implode(DIRECTORY_SEPARATOR, [
            rtrim(NAILS_COMMON_PATH, DIRECTORY_SEPARATOR),
            'views',
            'errors',
            $sType,
            $sView . '.php',
        ]);

        $sValidPath = null;
        foreach ($aPaths as $sPath) {
            if (file_exists($sPath)) {
                $sValidPath = $sPath;
                break;
            }
        }

        if ($sValidPath) {

            $oView = Factory::service('View');
            $oView->setData($aData);
            echo $oView->load($sValidPath, [], true);

        } else {
            static::halt('404 Page Not Found', '', HttpCodes::STATUS_NOT_FOUND);
        }
    }
276379
private function renderColumnSeparator($type = self::BORDER_OUTSIDE)
    {
        $borders = $this->style->getBorderChars();

        return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]);
    }
847327
private function loadView($sView, $aData = array())
    {
        $oView = Factory::service('View');
        $sFile = $this->oSkin->path . 'views/' . $sView;

        if (is_file($sFile . '.php')) {

            $oView->load($sFile, $aData);

        } elseif (!empty($this->oSkinParent)) {

            $sFile = $this->oSkinParent->path . 'views/' . $sView;

            if (is_file($sFile . '.php')) {
                $oView->load($sFile, $aData);
            } else {
                throw new NailsException('Failed to load blog view "' . $sView . '"');
            }

        } else {
            throw new NailsException('Failed to load blog view "' . $sView . '"');
        }
    }
112754
public function view($type = null, $id = null)
    {
        $this->_validateActionIsEnabled('view');

        $this->_event('beforeView', [
            'id' => $id
        ]);

        $data = $this->Model->get($id, [
            'contain' => $this->type['contain']
        ]);
        $this->set('data', $data);

        $this->_event('afterView', [
            'id' => $id
        ]);
    }
769414
public function Render($sSpotName = null, $aCallTimeVars = array())
    {
        $oView = new TViewParser();

        $oView->AddVar('oShop', $this->getShopService()->getActiveShop());
        $oView->AddVar('oStep', $this);

        $oStepNext = $this->GetNextStep();
        $oStepPrevious = $this->GetPreviousStep();
        $oView->AddVar('oStepNext', $oStepNext);
        $oView->AddVar('oStepPrevious', $oStepPrevious);

        $sBackLink = $this->GetReturnToLastStepURL();
        $oView->AddVar('sBackLink', $sBackLink);

        $oView->AddVar('sSpotName', $sSpotName);
        $oView->AddVar('aCallTimeVars', $aCallTimeVars);

        $sViewName = $this->GetRenderViewName();
        $sViewType = $this->GetRenderViewType();
        $aOtherParameters = &$this->GetAdditionalViewVariables($sViewName, $sViewType);
        $oView->AddVarArray($aOtherParameters);

        return $oView->RenderObjectPackageView($sViewName, $this->getStepViewPath(), $sViewType);
    }
1167125
public function renderPagebrowser()
    {
        /** @var \TYPO3\CMS\Fluid\View\StandaloneView $view */
        $view = GeneralUtility::makeInstance(\TYPO3\CMS\Fluid\View\StandaloneView::class);
        $view->setTemplateRootPaths($this->conf['view']['templateRootPaths']);
        $view->setTemplate('Widget/Pagination');
        $pagination = [];

        $numberOfResults = $this->numberOfResults;
        $resultsPerPage = $this->conf['resultsPerPage'];
        $maxPages = $this->conf['maxPagesInPagebrowser'];

        // get total number of items to show
        // show pagebrowser only if there are more entries that are shown on one page
        if ($numberOfResults > $resultsPerPage) {
            $this->limit = $resultsPerPage;
        } else {
            return;
        }

        // set db limit
        $start = ($this->piVars['page'] * $resultsPerPage) - $resultsPerPage;
        $this->dbLimit = $start . ',' . $resultsPerPage;
        $end = ($start + $resultsPerPage > $numberOfResults) ? $numberOfResults : ($start + $resultsPerPage);

        // number of pages
        $pagesTotal = ceil($numberOfResults / $resultsPerPage);

        // calculate start and end page
        $startPage = $this->piVars['page'] - ceil(($maxPages / 2));
        $endPage = $startPage + $maxPages - 1;
        if ($startPage < 1) {
            $startPage = 1;
            $endPage = $startPage + $maxPages - 1;
        }
        if ($startPage > $pagesTotal) {
            $startPage = $pagesTotal - $maxPages + 1;
            $endPage = $pagesTotal;
        }
        if ($endPage > $pagesTotal) {
            $startPage = $pagesTotal - $maxPages + 1;
            $endPage = $pagesTotal;
        }

        // create pages list, previous, current and next for pagination widget
        $pages = [];
        for ($i = 1; $i <= $pagesTotal; $i++) {
            if ($i >= $startPage && $i <= $endPage) {
                $pages[] = $i;
            }
        }
        $pagination['pages'] = $pages;

        if ($this->piVars['page'] > 1) {
            $pagination['previous'] = $this->piVars['page'] - 1;
        }

        if ($this->piVars['page'] < $pagesTotal) {
            $pagination['next'] = $this->piVars['page'] + 1;
        }

        $pagination['currentPage'] = $this->piVars['page'];
        $view->assign('pagination', $pagination);

        // render pagebrowser content and pass it together with some variables to fluid template
        $markerArray = array(
            'current' => $this->piVars['page'],
            'pages_total' => $pagesTotal,
            'pages_list' => $view->render(),
            'start' => $start + 1,
            'end' => $end,
            'total' => $numberOfResults,
            'results' => $this->pi_getLL('results'),
            'until' => $this->pi_getLL('until'),
            'of' => $this->pi_getLL('of'),
        );

        // hook for additional markers in pagebrowser
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['pagebrowseAdditionalMarker'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['pagebrowseAdditionalMarker'] as $_classRef) {
                $_procObj = &GeneralUtility::makeInstance($_classRef);
                $_procObj->pagebrowseAdditionalMarker(
                    $markerArray,
                    $this
                );
            }
        }

        $this->fluidTemplateVariables['pagebrowser'] = $markerArray;
    }
830152
public static function get(string $type): ImagineInterface
    {
        switch ($type) {
            case self::GD:
                return new GdImagine();
            case self::IMAGICK:
                return new ImagickImagine();
            case self::GMAGICK:
                return new GmagickImagine();
            default:
                throw new InvalidConfigException(sprintf('Image driver %s not found.', $type));
        }
    }
1185750
function render($context = null, $vars = array())
    {
        $directives = $this->getDirectives();

        foreach ($directives as $directive) {
            list($i, $name, $argv) = $directive;
            $this->executeDirective($name, $context, $argv);
        }

        return $this->getProcessedSource();
    }