I'm trying to render a php file in symfony2.
In config.yml I'm using:
# app/config/config.yml
framework:
# ...
templating: { engines: ['twig', 'php'] }
and in the Controller:
public function installAction($name) {
$finder = new Finder();
$finder->files()->in('../src/Admin/ModuleBundle/Modules/'.$name.'/')->directories();
foreach ($finder as $file) {
return $this->render($file.'/install.php');
}}
but I got this error: Template name "../src/Admin/ModuleBundle/Modules/Module1/config/install.php" contains invalid characters.
and the content of the file:
< ?php echo "Module1 install";
what I'm doing wrong? the php file is just a simple echo