Locked lesson.
About this lesson
How to use Require to template things.
Exercise files
Download this lesson’s related exercise files.
Templating With Require.docx59.3 KB Templating With Require - Solution.docx
59.3 KB
Quick reference
Templating with Require
In this video we'll look at using require for templating.
When to use
When your template is necessary to the app, use require.
Instructions
To recap, using require works like this:
require 'filename.php';
You would use it if the data in the file is necessary to your app. Remember, if there's a problem, require will crash your app.
Hints & tips
- Use require when the data in the required file is necessary to your app (your app can't run without it).
Lesson notes are only available for subscribers.