I use the branch as a template engine, but my html is not rendering. Everything is displayed with the HTML tags themselves.
Data from the database can be found by clicking here.
I searched for SO and got a lot of posts that provide a solution, but no one worked for me
Following are the solutions:
Use below code [ doesn't work ]
{{ detailArticle.artdesc|raw }}
or
{% autoescape false %}
{{ detailArticle.artdesc }}
{% endautoescape %}
Use filter and autoload as shown below [ doesn't work ]
$app->view = new \Slim\Views\Twig();
$app->view->setTemplatesDirectory("application/view");
$app->view->parserOptions = array(
'debug' => 'true',
'auto_reload' => true,
'autoescape' => true
);
$app->view->parserExtensions = array(new \Slim\Views\TwigExtension());
Clear Twig cache [ I don't have a CLI in cPanel, so I'm not sure how to do this )
rm -rf app/cache/* OR rm -rf app/cache/prod/twig OR app/console cache:clear --env=prod
None of the solutions working for me. Please guide.
Data is displayed in the same way as you will see on the link mentioned above.
My composer .json as below
{
"name":"panique/mini2",
"homepage":"https://github.com/panique/mini2",
"license":"MIT",
"require":{
"php":">=5.3.0",
"slim/slim": "~2.6",
"slim/views": "~0.1",
"twig/twig": "~1.16",
"panique/pdo-debug": "0.2",
"panique/php-sass": "~1.0",
"matthiasmullie/minify": "~1.3"
},
"autoload":{
"psr-4":{
"Mini\\": "Mini"
}
}
}