I am using Plesk for my project. It works fine when I render a twig file but when I render a php file in my Controller an error occurred:
"The template "::/var/www/vhosts/domain/httpdocs/project/templates/test.php" does not exist."
This is my code:
$this->render('/var/www/vhosts/domain/httpdocs/project/templates/test.php');
2
Answers
I added in framework.yaml templating: engines: ['twig', 'php'] So that I can reder a php file as mention in the documentation https://symfony.com/doc/current/templating/PHP.html
The above code is wrong in symfony. render function (used in the controller) is used for rendering twig file content. The above code gives the result like that