extend

@param mixed $template

@return void
553296
public function extend($template)
    {
        list ($resource,) = $this->getCurrent();

        //if (isset($this->parents[$hash = $resource->getHash()])) {
            //throw new RenderException('Circular reference.');
        //}

        $this->parents[$resource->getHash()] = $template;
    }
885764
public function create($template = false)
    {
        $this->addDefaultGeoFields($template);
        $this->useTemplate($template);

        return parent::create();
    }
601046
protected function templateExists($template)
    {
        if ($this->isBackoffice() || $this->inBackofficeRoot()) {
            $template = '@ClasticBackofficeBundle/Exception/exception_full.html.twig';
        }

        return parent::templateExists($template);
    }
276422
public function createTemplate(Template &$template)
		{
			$form_data = array(
				'template_name' => $template->getName(),
				'template_subject' => $template->getSubject(),
				'template_body_plain' => $template->getBodyPlain(),
				'template_body_html' => $template->getBodyHtml(),
				'template_body_mobile' => $template->getBodyMobile(),
				'charset' => $template->getCharacterSet(),
				'encoding' => $template->getCharacterEncoding(),
				'folder_id' => $template->getFolderId()
			);
			$data = $this->call('createtemplate', $form_data);

			$template->setTemplateId(trim($data[1]));

			//return $template;
		}
970754
public function compile(Template $template)
    {
        // Otherwise, we look for a compile method
        $method = 'compile'.ucfirst($template->getName());
        if (!method_exists($this, $method)) {
            return null;
        }

        return $this->$method($template);
    }
1228307
public function getTemplateFile($template)
	{
	    if (!is_file($template)) {
	        $template = $this->getTemplatePath() . $this->_getRelativeTemplate($template) . $this->getSuffix();
	    }
	    
	    return $template;
	}
899961
protected function renderTemplate($template)
    {
        // Build allowed extensions
        $allowedExtensions = new ArrayList();
        foreach (File::getAllowedExtensions() as $extension) {
            if ($extension) {
                $allowedExtensions->push(new ArrayData([
                    'Extension' => preg_quote($extension)
                ]));
            }
        }

        Config::nest();
        Config::modify()->set(SSViewer::class, 'source_file_comments', false);

        $viewer = SSViewer::create([$template]);
        $result = (string)$viewer->process(new ArrayData([
            'AllowedExtensions' => $allowedExtensions
        ]));

        Config::unnest();

        return $result;
    }
934196
public function setTemplate($template)
    {
        $layout = $this->getViewModel();
        $layout->setTemplate((string) $template);

        return $this;
    }
250652
public static function end_render($template)
    {
        $key = self::get_key($template);
        self::$template_data[$key]['render_time'] += microtime(true) - self::$template_data[$key]['start_time'];
    }
775228
protected function addTemplateAssets($template)
    {
        /** @var SplFileInfo $file_info */
        foreach ($template->getAssets() as $filename => $file_info) {
            $this->assets->set($filename, $file_info->getRelativePathname());
        }
    }
895890
public function setHTMLTemplate($template)
    {
        if (substr($template, -3) == '.ss') {
            $template = substr($template, 0, -3);
        }
        $this->HTMLTemplate = $template;

        return $this;
    }
5177
public static function extend($method) {
        if (is_array($method)) {
            if (count($method) == 2 && method_exists($method[0], $method[1])) {
                array_push(self::$_extends, ['class' => $method[0], 'method' => $method[1]]);
            }
            else {
                throw new MissingTemplateException('You c\'ant extend the template engine with the method : "' . $method[0] . '"');
            }
        }
        else {
            $trace = debug_backtrace();

            if (isset($trace[1])) {
                array_push(self::$_extends, ['class' => '\\' . $trace[1]['class'], 'method' => $method]);
            }
            else {
                throw new MissingTemplateException('Can\'t reach the method "' . $method . '"');
            }
        }
    }
561319
private function validateTwigTemplate($template)
    {
        $loader = $this->twig->getLoader();
        if (!$loader->exists($template)) {
            throw new \Exception(sprintf(
                'Unable to find template "%s".',
                $template
            ));
        }
    }
183875
public function setTemplate($template)
    {
        if(!$template instanceof TemplateInterface)
        {
            if(empty($template) || (is_string($template) && strpos($template, '.') === false) )
            {
                $identifier         = $this->getIdentifier()->toArray();
                $identifier['path'] = array('template');
                $identifier['name'] = $template;

                $identifier = $this->getIdentifier($identifier);
            }
            else $identifier = $this->getIdentifier($template);

            $template = $identifier;
        }

        $this->__template = $template;

        return $this->__template;
    }
660184
protected function iteratePaths($template): \Generator
    {
        foreach ($this->paths as $path) {
            yield sprintf('%s/%s', rtrim($path, '/'), ltrim($template, '/'));
        }
    }
1130357
protected function _parseExtend() {
        foreach (Template::$_extends as $extend) {
            $this->_content = $extend['class']::$extend['method']($this->_content);
        }

        foreach (Config::instance()->config['user']['template'] as $extend) {
            $this->_content = $extend['class']::$extend['method']($this->_content);
        }
    }
77772
protected function addMessage($template)
    {
        $arguments = func_get_args();
        $template = $arguments[0];

        $arguments[0] = $template;

        $this->message = sizeof($arguments) > 1
            ? call_user_func_array('sprintf', $arguments)
            : $this->message = $template;

        return $this;
    }