Render template

@param string $template
@return string
497122
public function render($template)
    {
        $file = $this->getTemplatesPath() . DIRECTORY_SEPARATOR .  ltrim($template, DIRECTORY_SEPARATOR);
        return $this->renderFile($file.'.phtml');
    }
404677
private function render($template, array $parameters = [])
    {
        if (!isset($this->resources[$template])) {
            $this->resources[$template] = $this->environment->loadTemplate($template);
        }

        return $this->resources[$template]->render($parameters);
    }
1209398
public function render_template() {
		// template
		$_output = null;

		if ( ! empty( $this->struct['template'] ) ) {
			ob_start();
			include $this->struct['template'];
			$_output .= ob_get_clean();
		}

		return $_output;
	}
1255093
private function _renderTemplate($template = null)
    {
        // when no template, auto generate template path.
        // View/Content/[controller]/[action].html.twig
        $def = $this->actionChain->getCurrentAction();
        if (! $template) {
            $controller = join(DS, array_map('ucfirst', explode('_', $def['controller_name'])));
            $action = $def['action'];
            $template = sprintf('%s/%s.%s', $controller, substr($this->actionChain->actionNameStrategy($action), 0, -6), $this->renderer->getSuffix());
        }

        // rendering by renderer.
        $def['controller']->beforeRenderer();
        $result = $this->renderer->render($template);
        $this->response->setBody($result);
        if ($this->response->isHttp()) {
            $this->response->setHeader('content-type', sprintf('text/html; charset=%s', $this->application->config('encoding.output')));
        }
    }
1292625
protected function getTemplate($template)
    {
        $source = __DIR__.'/../../templates/'.$template;
        return file_exists($source) ? file_get_contents($source) : null;
    }
995218
public function get($template)
    {
        $response = $this->request(self::REQUEST_GET, 'templates/'.$template);
        return $response->response;
    }
469033
protected function getTemplate($template)
    {
        $path = realpath(__DIR__.'/../templates/'.$template.'.txt');

        return $this->files->get($path);
    }
422276
protected function render($template, $context = [])
    {
        $context = array_merge($this->_context, $context);
        $body = $this->twig->render($template, $context);
        return $body;
    }
1220943
public function render($template, $data){
		$rtn = $this->twig->render($template, $data);
		return $rtn;
	}
1129785
protected function _renderTemplate($template) {
		if ($section = $this->_findSection($template)) {
			list($before, $type, $tag_name, $content, $after) = $section;

			$rendered_before = $this->_renderTags($before);

			$rendered_content = '';
			$val = $this->_getVariable($tag_name);
			switch($type) {
				// inverted section
				case '^':
					if (empty($val)) {
						$rendered_content = $this->_renderTemplate($content);
					}
					break;

				// regular section
				case '#':
					// higher order sections
					if ($this->_varIsCallable($val)) {
						$rendered_content = $this->_renderTemplate(call_user_func($val, $content));
					} else if ($this->_varIsIterable($val)) {
						foreach ($val as $local_context) {
							$this->_pushContext($local_context);
							$rendered_content .= $this->_renderTemplate($content);
							$this->_popContext();
						}
					} else if ($val) {
						if (is_array($val) || is_object($val)) {
							$this->_pushContext($val);
							$rendered_content = $this->_renderTemplate($content);
							$this->_popContext();
						} else {
							$rendered_content = $this->_renderTemplate($content);
						}
					}
					break;
			}

			return $rendered_before . $rendered_content . $this->_renderTemplate($after);
		}

		return $this->_renderTags($template);
	}
752816
public function renderView($template, array $parameters = array())
    {
        $parameters['module'] = $this->module->createView();

        return $this->getContainer()->get('templating')->render($template, $parameters);
    }
878121
private function getRenderer(string $template): string
    {
        if (is_readable($template) === false) {
            throw new View\Exception('Could not open file "' . basename($template) . '"');
        }

        $suffix = strtolower(pathinfo($template, PATHINFO_EXTENSION));

        if (isset($this->renderer[$suffix]) === false) {
            throw new View\Exception('No template engine registered for file extension "' . $suffix . '"');
        }

        return $this->renderer[$suffix];
    }
858336
public function render(string $template, array $data = []) : string
    {
        try {
            return $this->renderer->render($template, $data);
        } catch (Twig_Error_Loader $e) {
            throw new TemplateNotFoundException("Template '$template' not found by Twig renderer",
                null, $e);
        }
    }
274223
public function renderTemplate(string $template, array $variables = []): string
    {
        return $this->renderTemplateString($this->getTemplate($template), $variables);
    }
375059
public function render_controller($template)
    {
        $this->controllerReplacements[':app_namespace'] = $this->getAppNamespace();
        $this->controllerReplacements[':resource'] = $this->identifier;
        $this->controllerReplacements[':model_name'] = $this->command->model_name($this->identifier);
        $this->controllerReplacements[':request_name'] = $this->command->request_name($this->identifier);
        $this->controllerReplacements[':controller_name'] = $this->command->controller_name($this->identifier);
        $this->controllerReplacements[':identifier'] = $this->identifier;

        $routeName = empty($this->routeNames) ? $this->identifier : 'admin.'.$this->identifier;

        if ($this->options['create']) {
            $this->controllerReplacements[':create_route'] = '$this->viewData'."['createRoute'] = '".$routeName.".create';";
        }

        if ($this->options['edit']) {
            $this->controllerReplacements[':edit_route'] = '$this->viewData'."['editRoute'] = '".$routeName.".edit';";
        }

        if ($this->options['destroy']) {
            $this->controllerReplacements[':destroy_route'] = '$this->viewData'."['deleteRoute'] = '".$routeName.".destroy';";
        }

        $template = strtr($template, $this->controllerReplacements);

        return $template;
    }
1050836
protected function getTemplate($template)
    {
        $template = config("imagecache.templates.{$template}");

        switch (true) {
            // closure template found
            case is_callable($template):
                return $template;

            // filter template found
            case class_exists($template):
                return new $template;

            default:
                // template not found
                abort(404);
                break;
        }
    }
1001852
public function renderTemplateString(string $template, array $variables = []): string
    {
        $output = $this->indexControlStructure($template, 'foreach');
        $output = $this->indexControlStructure($output, 'if', ['else']);

        $output = $this->resolveLoops($output, $variables);
        $output = $this->resolveConditionals($output, $variables);

        return $this->replaceVariablesInTemplate($output, $variables);
    }