Skip to content

Commit

Permalink
minor #5781 Added annotations example to Linking to Pages examples (c…
Browse files Browse the repository at this point in the history
…arlos-granados)

This PR was merged into the 2.3 branch.

Discussion
----------

Added annotations example to Linking to Pages examples

In the routing examples for the Linking to Pages section there were no annotations examples (which is what most people use). I have added these examples

Commits
-------

43f751e Added missing namespace statements
5941b89 Remove indentation in blank line
05da696 Added missing use statements
30e0dd4 Added annotations example to Linking to Pages examples
  • Loading branch information
weaverryan committed Nov 5, 2015
2 parents 8b85020 + 43f751e commit 6d458d8
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,25 @@ configuration:

.. configuration-block::

.. code-block:: php-annotations
// src/AppBundle/Controller/WelcomeController.php
namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class WelcomeController extends Controller
{
/**
* @Route("/", name="_welcome")
*/
public function indexAction()
{
// ...
}
}
.. code-block:: yaml
# app/config/routing.yml
Expand Down Expand Up @@ -918,6 +937,25 @@ route:

.. configuration-block::

.. code-block:: php-annotations
// src/AppBundle/Controller/ArticleController.php
namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class ArticleController extends Controller
{
/**
* @Route("/article/{slug}", name="article_show")
*/
public function showAction($slug)
{
// ...
}
}
.. code-block:: yaml
# app/config/routing.yml
Expand Down

0 comments on commit 6d458d8

Please sign in to comment.