true, 'is_safe' => ['html', 'html_attrs'] ]), ]; } /** * Print `value` inside a template, or, if $value is empty, * print $message. * * The template can be customized. The template is a full path to another * template, or one of the key belows: * * - 'default' ; * - 'blockquote' ; * * @param Environment $twig * @param string $value * @param string $message * @param string $template * @return string */ public function printOrMessage( Environment $twig, $value, $message = 'No value', $template = 'default' ) { switch ($template) { case 'default': case 'blockquote': $t = '@ChillMain/Extensions/PrintOrMessage/'.$template.'.html.twig'; break; default: $t = $template; } return $twig->render($t, [ 'value' => $value, 'message' => $message ]); } }