Set fields (and labels) default templates for natural
(not customized with `*.phtml` view) field rendering.
@param array|\stdClass $templates
@return array
422965
public static function SetTemplates ($templates = []) {
		if (gettype(static::$templates) == 'array') {
			static::$templates = (array) $templates;
		} else {
			static::$templates = (object) $templates;
		}
		return static::$templates;
	}
1374578
public static function buildTemplates($models)
    {
        $result = [];
        foreach($models as $model) {
            $result[] = self::buildTemplate($model);
        }

        return $result;
    }
1373129
public function withTemplates(array $templates): Validator
    {
        $translator = $this->translator->withTemplates($templates);

        return new Validator($this->rules, $this->parser, $translator);
    }
224231
private function removeDefaultBlocks($activeBlockTemplates, $templateBlocksToExchange)
    {
        $templateBlocks = [];
        foreach ($activeBlockTemplates as $activeBlockTemplate) {
            if (!in_array($this->prepareBlockKey($activeBlockTemplate), $templateBlocksToExchange['theme'])
                || $activeBlockTemplate['OXTHEME']
            ) {
                $templateBlocks[] = $activeBlockTemplate;
            }
        }

        return $templateBlocks;
    }
10794
public function setTemplateMap(array $templateMap)
    {
        $this->templateMap = [];
        foreach ($templateMap as $name => $filename) {
            $this->addTemplate($name, $filename);
        }
    }
1172930
protected function mergeTemplateResources(TemplateResources $templateResources)
    {
        $this->stylesheets    = array_merge($this->stylesheets, $templateResources->getStylesheets());
        $this->headerScripts  = array_merge($this->headerScripts, $templateResources->getHeaderScripts());
        $this->headerIncludes = array_merge($this->headerIncludes, $templateResources->getHeaderIncludes());
        $this->footerScripts  = array_merge($this->footerScripts, $templateResources->getFooterScripts());
        $this->footerIncludes = array_merge($this->footerIncludes, $templateResources->getFooterIncludes());
    }
1240533
public function add(array $templates)
    {
        $this->setConfig($templates);
        $this->_compileTemplates(array_keys($templates));

        return $this;
    }
677752
public function set_template($template)
	{
		// make sure the template is a View
		if (is_string($template))
		{
			$this->template = $this->view($template);
		}
		else
		{
			$this->template = $template;
		}

		// return the template view for chaining
		return $this->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;
    }
718480
protected function _setTemplatesInternal(array $templates) {

        if (is_array($templates)) {

            foreach ($this->_userChangedTemplates as $key) {

                if (array_key_exists($key, $templates)) {
                    unset($templates[$key]);
                }
            }
        }

        $this->_setTemplatesWrapper($templates);
    }
783143
public function setFieldNames(array $fieldNames)
    {
        $this->field_names = $fieldNames;
        $this->src = [];
        foreach ($this->field_names as $name) {
            $this->src[$name] = 0;
        }
        return $this;
    }
934196
public function setTemplate($template)
    {
        $layout = $this->getViewModel();
        $layout->setTemplate((string) $template);

        return $this;
    }
1127178
protected static function initializeRows($template)
	{
		$layout = Bootstrap::getLayout();

		switch($layout->rows)
		{
			case '2rwh':
				$template->headerClass           = $layout->bootstrap_headerClass;

				$template->headerClassAttribute = sprintf(static::$classAttribute, $layout->bootstrap_headerClass);
				break;

			case '2rwf':
				$template->footerClass           = $layout->bootstrap_footerClass;

				$template->footerClassAttribute = sprintf(static::$classAttribute, $layout->bootstrap_footerClass);
				break;

			case '3rw':
				$template->headerClass           = $layout->bootstrap_headerClass;
				$template->footerClass           = $layout->bootstrap_footerClass;

				$template->headerClassAttribute = sprintf(static::$classAttribute, $layout->bootstrap_headerClass);
				$template->footerClassAttribute = sprintf(static::$classAttribute, $layout->bootstrap_footerClass);
				break;
		}
	}
469653
protected function _compileTemplates(array $templates = [])
    {
        if (empty($templates)) {
            $templates = array_keys($this->_config);
        }
        foreach ($templates as $name) {
            $template = $this->get($name);
            if ($template === null) {
                $this->_compiled[$name] = [null, null];
            }

            $template = str_replace('%', '%%', $template);
            preg_match_all('#\{\{([\w\._]+)\}\}#', $template, $matches);
            $this->_compiled[$name] = [
                str_replace($matches[0], '%s', $template),
                $matches[1]
            ];
        }
    }
1218309
public function setTemplate($template, array $template_variables = [])
	{
		$this->template = $template;
		$this->template_variables = $template_variables;

		return $this;
	}
931171
public function setTemplate($template)
    {
        $this->template = is_string($template) ? trim($template) : $template;

        return $this;
    }
300730
public function withTemplates(array $templates = []): Translator
    {
        $templates = array_merge($this->templates, $templates);

        return new Translator($this->labels, $templates);
    }