Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67527

twig template returns html characters

$
0
0

I have a problem relation with twig template.

it returns the raw html characters instead of html markup.

<?php
/* HomepageController.php */

namespace App\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;

class HomepageController extends AbstractController
{
    /**
     * @Route("/homepage/")
     */
    public function homepage()
    {
        return $this->render('homepage/homepage.html.twig', [
            'title' => 'this will be title',
        ]);
    }
}


homepage.html.twig

<h1>this should show html content</h1>
  <p>{{ title }} </p>

browser output

<h1>this should show html content</h1>
  <p>this will be title </p>

twig.yaml

twig:
    default_path: '%kernel.project_dir%/templates'
    debug: '%kernel.debug%'
    strict_variables: '%kernel.debug%'
    exception_controller: null

do you know what is the configuration i am missing to set


Viewing all articles
Browse latest Browse all 67527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>