A controller is not useful unless you can send input to it and get a response. That's to say, we need a way to interact with it. In this video, learn how you can pass parameters to the controller so eventually you can either interact with a model, or even send that parameter directly to the view. Also, explore some security issues regarding the treatment of data incoming from the user (or browser).
- [Voiceover] Routes are a great starting point…to make our application usable and maintainable…by making our routes more readable.…But unless we are able to send parameters to routes…they are useful only for static purposes.…Let's start by adding the routes to our header.…So let's open up our base templates…and let's add the routes.…Clients.…Reservations.…Let's also load our view for clients and reservations.…
So let's open our clients controller…and let's load a view with…return $this->render("clients/index.html.twig")…and let's open up…reservations controller.…And let's do the same.…return $this->render("reservation/index.html.twig")…and let's refresh on the browser.…
And as you can see whenever we click on clients…we now load our view.…And reservations and we now load our views.…Now we will want to send the client id through the url.…So let's look at the view.…Clients index.…And let's go to where our parameters should be sent.…Which is on edit.…And let's change it to client/edit/1.…We can do the same for book a room…
- Installing Symfony
- Setting up the local environment
- Exploring the Symfony file structure
- Creating routes
- Sending parameters to a controller
- Using views
- Updating routes
- Creating templates with Twig
- Data modeling with Symfony
- Demo application deployment
Skill Level Intermediate
PHP: Clean URLs on Apache Serverwith David Powers1h 36m Intermediate
PHP: Managing Persistent Sessionswith David Powers2h 41m Intermediate
1. Get Started with Symfony
Install Symfony1m 33s
2. Controllers in Symfony
3. Views in Symfony
4. Data Modeling with Symfony
5. Taking Symfony Further
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.