 Hey everybody, this is Brian. Welcome to the ninth yeet tutorial. Today's going to be a pretty simple tutorial, but it's actually a very important one. We're going to talk about static pages. So if you go to www.voidrealms.com, my website, you'll see the front page is actually pretty plain. I mean there's some some links and some images and stuff, but it doesn't really dynamically generate as opposed to say like tutorials which is constantly changing. You know, it's obviously pulling this out of a database. So if you're running a website and you've got a lot of hits, I mean maybe not even a lot of hits, maybe you're paying per CPU cycle or disk usage, you don't want to re-render this page. Like if you've got some PHP in here that's doing some stuff, you don't want to re-render this every time somebody requests it because it's a complete waste of the computer's time. On your little desktop it's not a big deal, but when you throw it on a server and you get hundreds of thousands of people, it becomes a big deal pretty fast. So how do you make a static page? First off, it's actually very simple. It's so ridiculously simple, you're not going to believe your eyes. Go to protected, views, and site and you'll see a subfolder called pages and in there you'll see about dot PHP. Open that up and you're going to see, well, it looks like a normal yee view and well you'd be right. It is a normal yee view. There's really nothing you have to do here other than just put it in the pages subfolder. Now, when you look at this you can also see there is PHP and we're calling some yee objects in here like the yee app, something we haven't covered yet. That's the global object for yee. So the point I'm trying to make here is you can actually put yee objects and PHP code in these static files. They're rendered initially and then somebody correct me if I'm wrong. I think they're re-rendered like once an hour or once every 24 hours or text of change or maybe aliens just come out of the sky and render it magically. I don't remember. I should probably research that. So point being this is rendered and it's cached on the disk so it's not re-rendered every single page request. So when you go out to your little website that we've been working on here and you click about notice how the route changes to something different. It's the controller is site and then we're saying the action is page. Now notice how the action is page. Let's actually jump out to the site controller here. You can see, well we can scroll through this whole thing, but you can see down here on the left our actions are contact error index log in log out and actions. Well we actually don't have a page so what's it doing here? It automatically knows because of this and view equals about. So what we're doing is we're saying take this controller, render a static view and this is the view we want to render about. So it's pretty much the same principle. It's just it's skipping over the whole action and it's just rendering a static page. So if you wanted to we could actually just you know make a new one here. Well let's not call tests called static test.php. I cannot type today. There was a new vulnerability that came out called shell shock which if you've ever used like a well I'm using Ubuntu right now but anything that uses bash it's this really nasty little bug that you can get a remote shell and actually execute code and my eyes are bleeding because I'm a patching servers all day. So static test and we're just gonna say yay. Now we made our static view as it's called and we're not even gonna modify the site controller. Now normally you would need an action to do the render and then render the view but we're not gonna do that. We're just gonna go back here and we're gonna say hmm was not found. What did I do wrong here? Ah yes see it's lower case case sensitive here. So if we do this yes. Yay there we go. So sorry about the mistake at the end there but that's all for this tutorial. Really what you need to take out of this is that static pages will save you a lot of money if you're on a third party host and you have a lot of content that never changes.