src/Charcoal/Admin/Property/AbstractPropertyInput.php
public function renderTranslatableTemplate($templateString)
    {
        if ($templateString instanceof Translation) {
            $origLang = $this->translator()->getLocale();
            foreach ($this->translator()->availableLocales() as $lang) {
                if (!isset($templateString[$lang])) {
                    continue;
                }
                $translation = $templateString[$lang];
                $isBlank = empty($translation) && !is_numeric($translation);
                if (!$isBlank) {
                    $this->translator()->setLocale($lang);
                    $translation = $this->renderTemplate($translation);
                    if ($translation !== null) {
                        $templateString[$lang] = $translation;
                    }
                }
            }
            $this->translator()->setLocale($origLang);
            $templateString->isRendered = true;

            return $templateString;
        } elseif (is_string($templateString)) {
            $isBlank = empty($templateString) && !is_numeric($templateString);
            if (!$isBlank) {
                return $this->renderTemplate($templateString);
            }
        }

        return '';
    }
public function renderTranslatableTemplate($templateString)
    {
        if ($templateString instanceof Translation) {
            $origLang = $this->translator()->getLocale();
            foreach ($this->translator()->availableLocales() as $lang) {
                if (!isset($templateString[$lang])) {
                    continue;
                }
                $translation = $templateString[$lang];
                $isBlank = empty($translation) && !is_numeric($translation);
                if (!$isBlank) {
                    $this->translator()->setLocale($lang);
                    $translation = $this->renderTemplate($translation);
                    if ($translation !== null) {
                        $templateString[$lang] = $translation;
                    }
                }
            }
            $this->translator()->setLocale($origLang);
            $templateString->isRendered = true;

            return $templateString;
        } elseif (is_string($templateString)) {
            $isBlank = empty($templateString) && !is_numeric($templateString);
            if (!$isBlank) {
                return $this->renderTemplate($templateString);
            }
        }

        return '';
    }
public function renderTranslatableTemplate ( $ templateString ) { if ( $ templateString instanceof Translation ) { $ origLang = $ this -> translator ( ) -> getLocale ( ) ; foreach ( $ this -> translator ( ) -> availableLocales ( ) as $ lang ) { if ( ! isset ( $ templateString [ $ lang ] ) ) { continue ; } $ translation = $ templateString [ $ lang ] ; $ isBlank = empty ( $ translation ) && ! is_numeric ( $ translation ) ; if ( ! $ isBlank ) { $ this -> translator ( ) -> setLocale ( $ lang ) ; $ translation = $ this -> renderTemplate ( $ translation ) ; if ( $ translation !== null ) { $ templateString [ $ lang ] = $ translation ; } } } $ this -> translator ( ) -> setLocale ( $ origLang ) ; $ templateString -> isRendered = true ; return $ templateString ; } elseif ( is_string ( $ templateString ) ) { $ isBlank = empty ( $ templateString ) && ! is_numeric ( $ templateString ) ; if ( ! $ isBlank ) { return $ this -> renderTemplate ( $ templateString ) ; } } return '' ; }
Render the given template from string.

@see    \Charcoal\View\ViewableInterface::renderTemplate()
@param  mixed $templateString The template to render.
@return string The rendered template.
Render the given template from string .