przewiń do treści

Symfony 2 od podstaw

Włodzimierz Gajda

class DefaultController extends Controller
{

    /**
     * @Route("/lorem.html")
     * @Template("::lorem.html.twig")
     */
    public function loremAction()
    {
        return array();
    }

    /**
     * @Route("/ipsum.html")
     * @Template(":Abc:ipsum.html.twig")
     */
    public function ipsumAction()
    {
        return array();
    }

    /**
     * @Route("/dolor.html")
     */
    public function dolorAction()
    {
        return $this->render("MySprBundle::dolor.html.twig");
    }

    /**
     * @Route("/sit.html")
     */
    public function sitAction()
    {
        return $this->render("MySprBundle:Def:sit.html.twig");
    }

}

Listing 9.4. Zmodyfikowany plik DefaultController.php

Rozdział 9. Twig

listing-09-04.txt

Reklama

Szkolenia z Symfony 2.1
©2012 Włodzimierz Gajda
ver. 1.0.1