Set the metabox template.

@param array|string $template
@param string       $screen

@return MetaboxInterface
344533
public function setTemplate($template, string $screen = 'page'): MetaboxInterface
    {
        $this->template[$screen] = (array) $template;

        return $this;
    }
1109013
public function setMailTemplate(\KRS\MailBundle\Entity\MailTemplate $mailTemplate = null)
    {
        $this->mailTemplate = $mailTemplate;
    
        return $this;
    }
10794
public function setTemplateMap(array $templateMap)
    {
        $this->templateMap = [];
        foreach ($templateMap as $name => $filename) {
            $this->addTemplate($name, $filename);
        }
    }
1313107
public static function update_template($template) {

        $params = self::validate_parameters(self::update_template_parameters(), array('template' => $template));
        $params = $params['template'];
        $template = api::read_template($params['id']);
        self::validate_context($template->get_context());

        $params = (object) $params;

        return api::update_template($params);
    }
357260
public function setTemplate()
    {
        // Creates the loader & sets the template directory path
        $loader = new FilesystemLoader('../src/View');

        // Creates the template engine
        $twig = new Environment($loader, array(
            'cache' => false,
            'debug' => true
        ));

        // Adds Twig extensions
        $twig->addExtension(new DebugExtension());
        $twig->addExtension(new PamTwigExtension());

        // Attributes the template engine to the current object
        $this->twig = $twig;
    }
1111041
public static function create(Template $template): self
    {
        $renderTemplateDirective = new self();

        $renderTemplateDirective->type     = self::TYPE;
        $renderTemplateDirective->template = $template;

        return $renderTemplateDirective;
    }
308770
private function messageFromTemplate(array $message, $template, array $templateVars)
    {
        if (!isset($message['html'])) {
            $htmlTemplate = 'emails/'.$template;
            $htmlView = new View($htmlTemplate, $templateVars);
            $message['html'] = $htmlView->render();
        }

        if (!isset($message['text'])) {
            $textTemplate = 'emails/text/'.$template;
            $textView = new View($textTemplate, $templateVars);
            $message['text'] = $textView->render();
        }

        return $message;
    }
460451
public function setView($templateName, $page, $action, array $attributes = [], $extension = "phtml")
    {
        $this->setTemplate($templateName);
        $this->setPage($page);
        $this->setAction($action);
        $this->setAttributes($attributes);
        $this->setExtension($extension);

        return $this;
    }
276190
protected function load($template){
		$template = get_stylesheet_directory()."/templates/admin/{$template}.php";
		/**
		 * wpametu_admin_screen_template
		 *
		 * @param string $template
		 * @param string $class_name
		 * @return string
		 */
		$template = apply_filters('wpametu_admin_screen_template', $template, get_called_class());
		if( file_exists($template) ){
			include $template;
		}
	}
1139603
public void setTemplate(String template) throws MissingIncludeException {
	PageSource ps = pageContext.getCurrentPageSource().getRealPage(template);
	if (!ps.exists()) throw new MissingIncludeException(ps);
	errorPage.setTemplate(ps);
    }
674536
public function textTemplate($template, $data=[]) {
		$data['message'] = $this;
		$res = $this->buildTemplate($template, $data);
		return $this->text($res);
	}
1094587
public function setUp(ThemeInterface $theme, TemplateManager $templateManager, PageBlocksInterface $pageBlocks, Template $template = null)
    {
        $this->templateManager = $templateManager;
        $this->pageBlocks = $pageBlocks;
        $this->theme = $theme;

        $this->dispatch(PageTreeEvent\PageTreeEvents::BEFORE_PAGE_TREE_SETUP, new PageTreeEvent\BeforePageTreeSetupEvent($this));

        $language = $this->getLanguage();
        $page = $this->getPage();
        if (null !== $language && null !== $page) {
            $this->pageBlocks->refresh($language->getId(), $page->getId());
        }

        $options = array();
        if (null !== $language) {
            $options["language"] = $language->getLanguageName();
        }

        $templateName = "";
        if (null !== $page) {
            $options["page"] = $page->getPageName();
            $templateName = $page->getTemplateName();
        }

        $this->template = (null === $template) ? $this->theme->getTemplate($templateName) : $template;
        if (null === $this->template) {
            return $this;
        }

        $this->assetsManager
            ->withExtraAssets($this->cmsMode)
            ->setUp($this->template, $options)
        ;

        $this->templateManager
             ->refresh($this->theme->getThemeSlots(), $this->template, $this->pageBlocks);

        $this->setUpMetaTags($this->getSeo());

        $this->dispatch(PageTreeEvent\PageTreeEvents::AFTER_PAGE_TREE_SETUP, new PageTreeEvent\AfterPageTreeSetupEvent($this));

        return $this;
    }
569913
public function setTemplate($template, $field = null)
    {
        if ($field === null) {
            $field = $this->last_column;
        }

        /** @type GiTemplate $gi */
        $gi = $this->add('GiTemplate');
        $this->columns[$field]['template'] = $gi->loadTemplateFromString($template);

        return $this;
    }
778131
public function setPostMessageTemplate($postMessage = null)
    {
        if (null !== $postMessage) {
            $postMessage = (string) $postMessage;
        }
        $this->abstractOptions['messageTemplates']
                              [self::POST_MESSAGE_TEMPLATE_KEY] = $postMessage;
        return $this;
    }
64767
private function setTemplate($instance)
    {
        // we don't know what is the template extension, so we need to match by action name
        if (!empty($this->getModule()) && $instance->app()->view()->getAutoload()) {
            $templateDir = Bootstrap::getInstance()
                                    ->getEnvironment()
                                    ->getApplicationAbsolutePath() . 'App/Modules/' . $this->getModule() . '/Views/' . $this->getController();

            if (!is_dir($templateDir)) {
                return false;
            }

            $templates = scandir($templateDir);
            if ($templates) {
                $tplFilename = '';

                $tplActionName = $this->str($this->getAction())->charFirstUpper()->val();

                foreach ($templates as $tpl) {
                    if (strpos($tpl, $tplActionName . '.') !== false) {
                        $tplFilename = $tpl;
                        break;
                    }
                }

                if ($tplFilename != '') {
                    $instance->app()
                             ->view()
                             ->setTemplate('../Modules/' . $this->getModule() . '/Views/' . $this->getController() . '/' . $tplFilename);

                    return true;
                }
            }
        }
    }
383457
public function addMessage($template)
    {
        $arguments = func_get_args();
        $key = null;
        $template = $arguments[0];
        if (array_key_exists($template, $this->_messageTemplates)) {
            $key = $template;
            $template = $this->_messageTemplates[$template];
        }
        $arguments[0] = $template;
        if (sizeof($arguments) > 1) {
            $this->_messages[$key] = call_user_func_array('sprintf', $arguments);
        } else {
            $this->_messages[$key] = $template;
        }
        return $this;
    }
169807
public function setTemplatesStatus(string $templates_status = "D") : CNabuDataObject
    {
        if ($templates_status === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$templates_status")
            );
        }
        $this->setValue('nb_messaging_lang_templates_status', $templates_status);
        
        return $this;
    }