Archived video

This video is archived and won't be updated. We're keeping it online for now as a courtesy.

Alternate resources: 

Symfony Controllers

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:03
    Symfony Controllers
  • 0:06
    with Leanna Pelham
  • 0:09
    Three steps, that's all that's behind rendering a page.
  • 0:13
    One, the URL is compared against the routes until one matches.
  • 0:17
    Two, Symfony reads the _controller key
  • 0:20
    and executes that function.
  • 0:22
    And three, we build the page inside the function.
  • 0:25
    The controller is all about us.
  • 0:27
    It's where we shine.
  • 0:29
    Whether the page is HTML, JSON or a redirect,
Loading ...

Symfony Controllers

Loading...

When it comes to rendering a page, the application compares the URL against the routes until one matches, Symfony reads the _controller key and executes that function. The page you want to render is built in the function. Controller functions are dead-simple, and there’s just one big rule: it must return a Symfony Response object. In this lesson, we'll build our Response, take a look at JSON, and then render the template using the Symfony templating service.

Downloads: 
Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.