Drupal 8 - Inline Template mit Raw - HTML

Submitted by Gast (nicht überprüft) on So, 11/08/2020 - 14:38

Controller könnte so aussehen:

<?php

class myController extends ControllerBase
{
    public function myFunc1()
    {
        $html = " ... ";
        return [
            '#type' => 'inline_template', 
            '#template' => '{{ html|raw }}', 
            '#context' => ['html' => $html]
        ];
    }
}

 

Neuen Kommentar schreiben

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.