This video will be available to
subscribers on Thu, May 22, 2025.
You must be a subscriber to view this video.
May 22, 2025
7m:43s

Dynamic Photo Page

Classification
Software Engineering | Languages | PHP
Keywords
oop | php

About This Episode:

Let’s make our photo pages come alive! In this video, we turn the static photo view into a fully dynamic experience by using the $_GET superglobal to load data based on query parameters. 🔍

Here’s what we tackle:


Update the PhotoController to read the id from $_GET and query the database accordingly
Show a 404 error if the id is missing or the record isn’t found 🛑
Improve our error views (404 and 500) by rendering them within the layout for a consistent look 🎨
Refactor the View class to default to the main layout (layout.app) while still allowing overrides
Fix a potential infinite render loop in the layout logic 🐛
Clean up unnecessary calls to ->layout() by relying on the new default behavior 🧼


By the end, version v13-photo-query-param will serve up the right photo with the right layout—dynamically and elegantly. 🚀
Bob Cravens

Bob Cravens

Your Instructor
more »
Owner
TekFoundry
Wisconsin
United States
Short Bio:
Bob Cravens is a seasoned technology leader, software architect, and educator with a passion for empowering others through practical, real-world knowledge. As the founder of TekFoundry, Bob has dedicated his career to designing and delivering innovative software solutions that combine cutting-edge technology with elegant simplicity.

At TekCasts, Bob leverages over two decades of experience in software engineering, application architecture, and team leadership to create engaging, high-impact courses for developers and technology professionals. His instructional style is rooted in practical application, offering insights drawn from his extensive background in industries like medical devices and global technology consulting.

Bob’s expertise spans a variety of technologies and methodologies, including PHP/Laravel, FastAPI, and DevOps, as well as architecture best practices and team dynamics. Whether teaching foundational concepts or advanced strategies, he’s passionate about helping others turn complex challenges into streamlined solutions.

When not crafting elegant code or inspiring the next generation of tech innovators, Bob enjoys exploring the intersection of technology, business strategy, and creative problem-solving.