From the course: Learning PHP

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Build a simple templating system for the provided markup

Solution: Build a simple templating system for the provided markup - PHP Tutorial

From the course: Learning PHP

Start my 1-month free trial

Solution: Build a simple templating system for the provided markup

(upbeat music) - [Instructor] All right, let's take a look at the solution for our website template challenge. Here's the resulting HTML. And if we go back to our directory, you can see that we have a single index.PHP file that we want to convert into templates. So I'm going to go ahead and create two directories here. And I should say right off the bat that you probably did this differently. There are a lot of different ways that you can solve this problem And this is just one of the many solutions. So I'm going to create a folder called Inc and a folder called templates. I'm doing this because I like to keep my projects organized in this way, where Inc is where straight up PHP files go. Things like variables or functions and templates are where the different HTML sections go. So, again, right off the bat, I see a set of variables here. I'm going to cut them out of this file and I'm going to create a new file inside Inc…

Contents