From the course: PHP with MySQL Essential Training: 2 Build a CMS
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Scope page position by subject
From the course: PHP with MySQL Essential Training: 2 Build a CMS
Scope page position by subject
- [Instructor] So far in this chapter, we've learned how we can nest our pages underneath our subjects. And in the last movie, we talked about how we can more efficiently count the number of pages that belong to each subject. I now want to take those two ideas and combine them together to talk about how we scope the page position by its subject. You may or may not have noticed that we actually have a problem in our current code. If we go to one of our subjects, we view the pages and then I click on one of the pages to edit it. If I look at the position listing, you'll see that I have 13 different positions available. Why is that? Well it's because I have 13 different pages, but that doesn't seem quite right. It seems like instead that I should have positions one, two, three, and four, right? That it should be scoped by the subject. And then for another subject, such as over here on consumer, I ought to have positions one, two and three, right? I should never ever run into a case where…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Understand nested resources3m 20s
-
(Locked)
List pages by subject4m 41s
-
(Locked)
Use nested links7m 38s
-
(Locked)
Use nested redirects4m 56s
-
(Locked)
Add page count to each subject6m 51s
-
(Locked)
Scope page position by subject4m 34s
-
(Locked)
Challenge: Update positions7m 22s
-
(Locked)
Solution: Update positions9m 12s
-
(Locked)
-