So how do we do that?
What we do is we basically use this require to do this over and over.
This is the index.php code.
And it starts in PHP and it says, okay, let's require this top bit and
then require nav.
And the top is the non-printing stuff like the title and the head and all that stuff.
And then, nav is this little navigation bar.
And so, there are two files, top.php and nav.php.
And then, I have the body of it, which is right from here to here.
And then I include a footer.
In this case, the footer,
I have this automatic Google Translation thing that I put in my little webpage,
which translates this page into various, it uses Google's automated translation.
It translates that page into a various language.
So we can sort of see how that works.
And this is something I want to do on every page.
So I have foot.php.
So there are three files, top.php, nav.php, and
foot.php, that then I can put different content.
So this is the unique content.
So if we take a look at a different page, this page here, which is install.php,
has the same top part of the two requires and the same bottom part.
So that this stuff is the same and then this stuff is the same.
And then in the body part, I have this div, which is from here to there.
This happens to be an iframe that's pulling in a different file, yada yada,
so that comes in.
So it allows you to have these consistent elements over and
over again that put markup and repeat in.
So that's a way to break things into more than one file, and to not repeat yourself.
Don't repeat yourself.
That's what you want.
Modularity is really just the idea of capturing something once, and
reusing it over and over.
So in this series of lectures, we talked about modularity in general.
We talked about using functions that exist, like the string functions or
the array functions, making new functions.
How to pass by value and pass by reference, and
that's kind of a unique to PHP.
And how we include and require files.
And then the idea of writing code that works on various versions,
given that PHP unabashedly makes changes that are not present in all versions,
either adding or removing functionality as the PHP version kind of increases.
So I hope that's been useful to you, and we'll see you in the next lecture.