class DefaultController extends Controller
{
public function indexAction($page, $name) {
return $this->render('default/new.html.php'
// , array(
// $name => 'bob'
// )
);
}
}
new.html.php
<p>Welcome to the index <?= $name; ?></p>
When I use this code it is returning an error message.
But,
<p>Welcome to the index {{ name }}
this returns me correct output.
I want to use .html.php instead of .html.twig
I am going through this https://symfony.com/doc/3.4/templating/PHP.html
routing.yml
app:
path: /dd
defaults:
_controller: AppBundle:Default:index
page: 1
name: "bob"
config.yml
framework:
# ...
templating:
engines: ['twig', 'php']
Note: I am using ubuntu16.04 and Symfony 3.4