I am trying to create a website with Symfony 2.0 and I am running into an issue where I see extend("...") ?> from <?php $this->extend("...") ?>.
The site is viewable at http://symfony.toxic-productions.com/install/web/poshpaws/hello.
The code for the controller:
<?php
namespace Acme\HelloBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class HelloController extends Controller
{
public function indexAction($name)
{
//return $this->render('AcmeHelloBundle:Hello:index.html.twig', array('name' => $name));
// render a PHP template instead
return $this->render('AcmeHelloBundle:Hello:index.html.php', array('name' => $name));
}
}
?>
The code for the frontend page (index.html.php)
<html>
<head>
<title>Poshpaws</title>
<?php
$view->extend('::base.html.php');
echo($head);
?>
</head>
<body>
<?php echo($body); ?>
<h1>This is just a page to say: Hello <?php echo $view->escape($name) ?>!</h1>
</body>
</html>
<?phptags which means PHP is not parsing that file at all and it is being served directly by the web server without any processing applied. Are you calling the right file? Sorry I haven't used Symfony but you appear to be calling the view directly and I don't think the controller is getting called..htaccessfile for handling all the requests is not in the right place. It should be in thewebfolder.