I'm just starting with Symfony 2.7.3.
I've been reading "the Book", trying to piece the new-to-me concepts together.
I've put together my 1st simple example -- my 'Front Page'.
With the code below, I' expecting to see a blank page with just the words "TEST TEST" on it when I nav to
http://example.com/app_dev.php/
Instead I see the standard Symfony Welcome Page,
Welcome to Symfony 2.7.3
Your application is ready to start working on it at: /srv/www/test1/symfony/
What's next?
Read Symfony documentation to learn
How to create your first page in Symfony
I can't figure out why I'm still seeing that and not my "TEST TEST".
I'm staring at this and know I have to have missed SOMETHING simple that should be obvious :-/ But what? Staring at it more isn't getting me anywhere.
Why don't I see the "TEST TEST", and what do I need to fix here?
./app/config/routing.yml
_frontpage:
path: /
defaults: { _controller: AppBundle:FrontPage:index }
./src/AppBundle/Controller/FrontPageController.php
<?php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class FrontPageController extends Controller
{
/**
* @Route("/", name="index")
*/
public function indexAction() {
return $this->render('default/page-front.html.twig');
}
}
./app/Resources/views/base.html.twig
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}this title{% endblock %}</title>
{% block meta %}
<meta charset="UTF-8" />
{% endblock %}
{% block stylesheets %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
{% block javascripts %}{% endblock %}
</body>
</html>
./app/Resources/views/default/page-front.html.twig
{% extends 'base.html.twig' %}
{% block title %}Changed Title{% endblock %}
{% block body %}
<div><p>TEST TEST</p></div>
{% endblock %}
{% block stylesheets %}
{% endblock %}