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…
Author
Released
3/30/2017- 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
Duration
Views
Related Courses
-
PHP: Clean URLs on Apache Server
with David Powers1h 36m Intermediate -
PHP: Managing Persistent Sessions
with David Powers2h 41m Intermediate -
PHP: Creating Secure Websites
with Kevin Skoglund4h 15m Intermediate
-
Introduction
-
Welcome1m 2s
-
Using the exercise files1m 2s
-
Project overview1m 3s
-
What is Symfony?3m 30s
-
-
1. Get Started with Symfony
-
Install Symfony1m 33s
-
-
2. Controllers in Symfony
-
Create routes5m 52s
-
Use views3m 33s
-
3. Views in Symfony
-
Update routes1m 9s
-
Mock up data4m 17s
-
Use forms, part 13m 23s
-
Use forms, part 22m 49s
-
-
4. Data Modeling with Symfony
-
Introduction to Doctrine3m 32s
-
Structure the database3m 9s
-
Database relationships2m 39s
-
Insert data with Doctrine3m 45s
-
Select data with Doctrine3m 50s
-
Edit entities1m 16s
-
Work with relational data4m 22s
-
Debug the application3m 34s
-
-
5. Taking Symfony Further
-
Composer3m 30s
-
PHPUnit4m 14s
-
Log data2m 25s
-
Demo application deployment4m 17s
-
-
Conclusion
-
Next steps26s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake 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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Send parameters to a controller