While you may get data from the browser (URL) or even a model (DB), you still have to present the data to the user. This is where views come in. The basic path is the user calls a route and the application calls a controller, which in turn may fetch data through an entity, return to the controller and finally pass data to the view. This may have small variations but it's basically what your application and framework will always do.
- [Narrator] So now that we have our template set up,…and our views look a lot cleaner,…let's prepare our application to use real data.…Prior to using data from our database,…let's mock up our client's details.…So let's open our client's controller.…Remember we have to erase, clients, and titles.…So let's use the array of clients to emulate how we would…handle the client's details.…So on our show details method,…let's add the client ID to the route, and to the method.…
Modify, so let's add a new parameter called id client,…and let's add id client as a variable.…We also need a request object on both show details,…and show new methods, so let's do that.…Let's add a request, request, call it request,…and let's just copy it, and paste it on the show new method.…Make sure you have the request component…via a use statement.…This is at the beginning of the class,…we have the request component loaded, so let's go back.…
This is so whenever we decide to process a form,…we can grab the data being sent.…Let's also send a mode variable to each form,…
- 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.