Brought to you with tenderness by the Knp team
KnpIpsum

A Symfony2 Tutorial Application

SensioFrameworkExtraBundle Tutorial

In the current controller you are using SensioFrameworkExtraBundle.

Have a look at the annotations on top of the action to discover how it works.

Code behind this page

User Story

src/Knp/IpsumBundle/Features/SensioFrameworkExtra.feature
Feature: Sensio FrameworkExtra
  In order to be more RAD
  As a Symfony2 developer
  I need to be able to use annotations to define routes

  Scenario: User clicks "SensioFrameworkExtraBundle" link on home page
    Given I am on homepage
    When I follow "SensioFrameworkExtraBundle"
    Then I should see "In the current controller you are using SensioFrameworkExtraBundle"

Controller Code

src/Knp/IpsumBundle/Controller/SensioFrameworkExtraController.php:18
/**
 * @Route("/", name="knp_ipsum_sensio_frameworkextra")
 * @Template()
 */
public function indexAction()
{
    return array();
}

Template Code

src/Knp/IpsumBundle/Resources/views/SensioFrameworkExtra/index.html.twig
{% extends "KnpIpsumBundle::layout.html.twig" %}

{% block title "SensioFrameworkExtraBundle Tutorial" %}

{% block content %}
    <p class="content-margin">In the current controller you are using SensioFrameworkExtraBundle.</p>

    <p>Have a look at the annotations on top of the action to discover how it works.</p>
{% endblock %}