1
00:00:00,300 --> 00:00:03,210
I don't want to make any other
changes to my header, so
2
00:00:03,210 --> 00:00:05,880
I'm just going to ignore the headblock.
3
00:00:05,880 --> 00:00:08,760
Now I'm ready to add the main content.
4
00:00:08,760 --> 00:00:13,834
For now, we're just going to
add an h1 header to the page.
5
00:00:13,834 --> 00:00:16,065
block content.
6
00:00:19,274 --> 00:00:22,701
Contact Us.
7
00:00:26,830 --> 00:00:28,019
And we'll end the block.
8
00:00:30,804 --> 00:00:37,660
We need to tell our index.html file when
to call the home versus the contact page.
9
00:00:37,660 --> 00:00:41,150
But first we need to make sure
that our server will know to
10
00:00:41,150 --> 00:00:44,620
use index.php as our controller.
11
00:00:44,620 --> 00:00:48,270
Check the notes for
the htaccess file that you'll need.
12
00:00:48,270 --> 00:00:50,570
It was included with the downloads.
13
00:00:52,440 --> 00:00:57,211
We'll put it into our public folder.
14
00:00:57,211 --> 00:01:03,313
And make sure that this
is named .htaccess.
15
00:01:03,313 --> 00:01:06,544
There are some great routing
packages that you can use.
16
00:01:06,544 --> 00:01:10,430
And if you're using a framework,
it will include routing.
17
00:01:10,430 --> 00:01:13,788
Since that's not the focus of this course,
18
00:01:13,788 --> 00:01:19,062
I'm gonna set up some simple routing
myself in the index.php file.
19
00:01:19,062 --> 00:01:24,530
After I describe my navigation,
I'm gonna check the request URI.
20
00:01:24,530 --> 00:01:26,904
This will tell me which page I will show.
21
00:01:26,904 --> 00:01:31,060
i'm gonna use a condition, if,
and then I'll use a substring.
22
00:01:33,550 --> 00:01:38,442
And I'll check my server.
23
00:01:38,442 --> 00:01:42,547
REQUEST_URI.
24
00:01:42,547 --> 00:01:47,760
I'm going to start with the first
character and grab the first 8 characters.
25
00:01:49,280 --> 00:01:54,777
I'm going to then compare
that to /contact.
26
00:02:05,399 --> 00:02:09,980
This isn't the most robust conditional,
which is why there are packages.
27
00:02:09,980 --> 00:02:13,970
But it will work for our example and
allow for a query string.
28
00:02:13,970 --> 00:02:20,653
I'm going to duplicate this render line,
And then I'm going to add an else.
29
00:02:26,152 --> 00:02:31,350
Now I can tell my contact route
to use my contact.twig file.
30
00:02:34,098 --> 00:02:38,030
Finally, I want the navigation
to have the correct status.
31
00:02:39,110 --> 00:02:42,586
I'm going to change the default for
both items to false.
32
00:02:44,841 --> 00:02:51,481
And then within my routing,
I'm going to say,
33
00:02:51,481 --> 00:02:59,455
$nav['contact'] ['status'] = 'active'.
34
00:02:59,455 --> 00:03:02,792
And then in home,
35
00:03:02,792 --> 00:03:10,136
$nav['home']['status'] =
36
00:03:10,136 --> 00:03:12,808
'active'.
37
00:03:12,808 --> 00:03:14,860
Now we're ready to try our new page.
38
00:03:16,240 --> 00:03:19,910
Now we can navigate between contact and
welcome.
39
00:03:21,100 --> 00:03:23,300
We're ready to display a form.