Render a view file.

@param ResponseInterface $response
@param string $view   Path of view file started from 'views' directory
@param array  $params Assosiative array containing parameters to be passed to view
@return ResponseInterface
497059
public static function render(ResponseInterface $response, $view, array $params = [])
    {
        return Application::getInstance()->view->render($response, $view, $params);
    }
1334448
public function render($view, $params = array()) {
        $viewPath = $this->viewPath;
        $viewPath = rtrim($viewPath, '/').'/';
        extract($params);
        if (is_file($view)) {
            require_once($view);
        } else if (is_file($viewPath.str_replace(':', '/', $view))) {
            require_once($viewPath.str_replace(':', '/', $view));
        } else {
            echo $view;
        }
    }
1286162
public function renderView($viewName,$parameters=[]){
		$twig=$this->container->get("twig");
		$this->compile($parameters);
		return new Response($twig->render($viewName, $parameters));
	}
1013152
public function render(string $view, array $with = null): string
    {
        $path = $this->getViewPath($view);

        if (!file_exists($path)) {
            throw new ResponseException("View ({$view}) not found on path={$path}");
        }

        if ($with !== null && count($with) > 0) {
            foreach ($with as $variableName => $value) {
                if (!is_string($variableName)) {
                    throw new ResponseException('Invalid argument name, expected string, got ' . gettype($variableName));
                }

                $$variableName = $value;
            }
        }

        ob_start(null, 0, PHP_OUTPUT_HANDLER_CLEANABLE | PHP_OUTPUT_HANDLER_FLUSHABLE | PHP_OUTPUT_HANDLER_REMOVABLE);

        require $path;

        return ob_get_clean();
    }
46732
public function get( ServerRequestInterface $request, ResponseInterface $response )
	{
		$view = $this->getView();

		try
		{
			$response = $this->getItem( $view, $request, $response );
			$status = 200;
		}
		catch( \Aimeos\MShop\Exception $e )
		{
			$status = 404;
			$view->errors = $this->getErrorDetails( $e, 'mshop' );
		}
		catch( \Exception $e )
		{
			$status = 500;
			$view->errors = $this->getErrorDetails( $e );
		}

		/** client/jsonapi/catalog/standard/template
		 * Relative path to the catalog lists JSON API template
		 *
		 * The template file contains the code and processing instructions
		 * to generate the result shown in the JSON API body. The
		 * configuration string is the path to the template file relative
		 * to the templates directory (usually in client/jsonapi/templates).
		 *
		 * You can overwrite the template file configuration in extensions and
		 * provide alternative templates. These alternative templates should be
		 * named like the default one but with the string "default" replaced by
		 * an unique name. You may use the name of your project for this. If
		 * you've implemented an alternative client class as well, "standard"
		 * should be replaced by the name of the new class.
		 *
		 * @param string Relative path to the template creating the body for the GET method of the JSON API
		 * @since 2017.03
		 * @category Developer
		 */
		$tplconf = 'client/jsonapi/catalog/standard/template';
		$default = 'catalog/standard';

		$body = $view->render( $view->config( $tplconf, $default ) );

		return $response->withHeader( 'Allow', 'GET,OPTIONS' )
			->withHeader( 'Cache-Control', 'max-age=300' )
			->withHeader( 'Content-Type', 'application/vnd.api+json' )
			->withBody( $view->response()->createStreamFromString( $body ) )
			->withStatus( $status );
	}
18080
public function view($view, $data = [], $mergeData = [])
    {
        return $this->response(View::make($view, $data, $mergeData));
    }
706488
public function template($view, array $param = [], $return = false)
    {
        $this->setTwigEnvironment();
        $path = $this->getPath(Inflector::toDirectorySeparator($view), true);

        /*
         | We will check if tpl is holding the object of
         | twig, then we will set twig template
         | environment
         */
        if (is_object(static::$twigEnvironment)/* && is_file($path)*/) {
            $this->setTwigTemplateInstance($view);
        }
        /*
        | We will check is twig template instance exists
        | then we will render twig template with parameters
        */
        if (is_object(static::$twigEnvironment) && is_object($this->get('twig_template'))) {
            return ($return) ?
                $this->get('twig_template')->render($param) :
                $this->get('twig_template')->display($param);
        }

        return $this;
    }
699150
public function render(ResponseInterface $response, $template, array $data = array())
    {
        $this->view->loadFile($this->templatesPath . DIRECTORY_SEPARATOR . $template);
        $this->renderWithData($response, $data);
        return $response;
    }
915129
public function render($template, array $parameters = null, Response $response = null)
    {
        $parameters = array_merge([
            'request'              => $this->getRequest(),
            'routing'              => $this->routing,
            'flash_bag'            => $this->application->getSession()->getFlashBag(),
        ], $parameters ?: []);

        return $this->application->getRenderer()->partial($template, $parameters);
    }
1139984
public function render($template=null, array $params=[]) {
		if($template === null)
			$template = $this->template;
		$params = array_merge($this->params, $params);

		return static::renderFile($template, $params);
	}
1090503
public function render(string $view = null, array $params = null): \Illuminate\Contracts\Support\Renderable
    {
        $view = $view ? $view : 'column.treeControl';
        $params = $params ? $params : $this->toArray();

        return GridView::view($view, $params);
    }
398967
protected function getTemplateFile(Response $response) {
    if (self::$sharedView == null) {
      self::$sharedView = ObjectFactory::getInstance('view');
    }
    // check if a view template is defined
    $viewTpl = self::$sharedView->getTemplate($response->getSender(),
                  $response->getContext(), $response->getAction());
    if (!$viewTpl) {
      throw new ConfigurationException("View definition missing for ".
                  "response: ".$response->__toString());
    }

    // check for html_format property in response
    // and add the suffix if existing
    $viewTplFile = WCMF_BASE.$viewTpl;
    $format = $response->getProperty('html_tpl_format');
    if (isset($format)) {
      $ext = pathinfo($viewTplFile, PATHINFO_EXTENSION);
      $formatViewTplFile = dirname($viewTplFile).'/'.basename($viewTplFile, ".$ext").'-'.$format.'.'.$ext;
    }

    // give precedence to format specific file
    $finalTplFile = isset($formatViewTplFile) && file_exists($formatViewTplFile) ?
            $formatViewTplFile : $viewTplFile;
    return $finalTplFile;
  }
932112
protected function render($view, array $parameters = array(), Response $response = null)
    {
        return $this->app->render($view, $parameters, $response);
    }
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();
    }
658187
private function renderFile($view, $parmas = array(), $sharedData = array()) {
        $templateEngine = Config::get('template_engine');

        if ($templateEngine) {
            $engineName = key($templateEngine);
            $engineConfigs = $templateEngine[$engineName];

            return HookManager::call('templateRenderer', [
                        'configs' => $engineConfigs,
                        'currentModule' => self::$currentRoute['module'],
                        'view' => $view,
                        'params' => $parmas,
                        'sharedData' => $sharedData
            ]);
        } else {
            return self::defaultRenderer($view, $parmas, $sharedData);
        }
    }
768024
public function renderFile(MediaInterface $file, array $params = [])
    {
        if (in_array($file->getType(), [MediaTypes::FILE, MediaTypes::ARCHIVE])) {
            throw new \InvalidArgumentException('Expected media with "file" or "archive" type.');
        }

        $params = array_replace([
            'attr' => [
                'id' => 'image-' . $file->getId(),
            ],
        ], $params);

        return $this->elementTemplate->renderBlock('image', [
            'attr'   => $params['attr'],
            'href'   => $this->getDownloadUrl($file),
            'title'  => $file->getTitle(),
        ]);
    }
53975
public function render($content, Response $response)
    {
        $response->setStatusCode(Response::HTTP_OK);
        $response->headers->set('Content-Type', 'application/json');
        $response->setContent(json_encode($content));

        return $response;
    }