 Hey everybody, this is Brian and welcome to the second yeet tutorial. On our last tutorial we talked about how to actually build this beautiful little website you see in front of you. So if you missed that, go back and view yeet tutorial one. Alright so today we are going to dive right in and walk through the framework and the main PHP. So here's our directory and you can see here's our test folder. Each one of these is a different web app. You dive in. First thing you'll notice is index.php because well it's got to do something somewhere right? So when you actually go to your site, it's in the test directory so if you just go test and you click on something you'll notice it says index.php. So this is called the bootstrap file or the boot php file or the boot index depending on which tutorial you're actually reading. So everything is going through index and then it has what's called a route which we will talk about in future tutorials. Finally what you need to understand is everything is going through index and then it uses the route to figure out what logic it needs to point you in the right direction. Alright so this tutorial we are going to talk about the framework and just kind of walk through some of these things here. So for this tutorial I'm using NetBeans IDE 8.0. You can use whatever you want it's just personal preference. I'm going to expand the test folder and you'll instantly see we have some other folders in here like we have assets, CSS, images, protected themes and then there's our index test and index php. So if you open index php you'll see it points to the E-framework location. That's very important if you move your site to a different server and the E-framework is in a different location you'll need to modify that path to find the framework and from there it just works. You can also set your trace level and your debug level. Alright so what are all these folders? We're going to go over these very high level assets. You see this random number here? Well ye is cacheable and what that means is when you visit the page, let's actually go here, you can just click that. What it will do is it will actually generate these assets and cache them. That's extremely important if you have websites with high volumes of visitors because you don't want to regenerate the same content over and over and over so what this does is it caches it for a certain period of time so if just for the sake of argument let's say this was pulling from a database this would cache it for a certain period of time so that database query isn't being redone every 40 milliseconds when you have 3 million visitors hitting your site. That is awesome. Yee has some of the best catching features I've ever seen. I'm just going to throw that right out there. Alright so we'll go here. So that's your assets folder, CSS, well you guessed it, Cascading Style Sheets. Yee is very big on Cascading Style Sheets and here's the default ones for our site. Not really super important that you know each specific one. They're pretty self-explanatory. Form is for forms, IE as well. You guessed it for Internet Explorer. Main is kind of the heart, it shows like the body, the page, the header, content, etc. Print is a little bit of fonts and screen is, well you guessed it, for screen stuff. I shouldn't say screen stuff. It's for like your basic, your H's and your P's, your A's, etc. Trying to keep these tutorials very dumbed down if you haven't noticed already. Images is the preferred folder you throw your images in, protected. This is where the guts of the framework are. We'll get to that in a second. We're going to skip over that and go to themes. Remember I said the last one, Yee is themeable. Here's the classic theme which is what your website is currently using. You can download or create your own theme and it's just got some views, layouts and it's pretty easy, pretty simple to understand. So protected. We've got the command shells. There's nothing in there, components. Components are just reusable classes. You can see we've got a controller and a user identity. We'll cover those in future tutorials. This tutorial is just a high level overview of what you're actually looking at here. Config, we're going to go over main.php in detail in this tutorial. But you also have console and test. Config main php. This is the heart of your web app. This is where all your configuration is going to take place. For example, your name, your logging. What you're importing, GE, which is something we'll cover in a future tutorial, which is how you dynamically create web pages without any coding whatsoever. Auto log in, URL manager, database connectivity, you can see how it's already set up for SQL Lite. You can set it up for MySQL right here. Logging, parameters, all right, so we'll get all that in a second here. Site controllers, schemas for data, extensions, yes, GE can have extensions or plugins if you will. Messaging, migrations, models. Models are, how should I put this? If you don't understand what a model is for model view controller framework, we're going to cover it in a future tutorial. But basically a model is the representation of the data. Just bear that in mind. That's why it's got a special little folder. The runtime folder is really nothing in it. Tests, just have some basic testing. Vendor, nothing. Views. Views are part of the model view controller framework. We'll cover those in future tutorials. They just understand at this point where the folder is. So now that you've got a broad overview of this, let's jump back. And I'm going to close it just so we can get used to finding it here. You're going to go to config and main PHP. And we're going to dive into this a little bit here. Notice how it says return array. I hope you paid attention when you're studying PHP and you learned about arrays because ye is very array heavy. And it seems kind of a pain at first until you really start working with it and then you understand why it's array heavy. You just pass an array and it just works. Because of a simple data container, basically. So base path. This is the path of your web app, basically. The name is the name of your app. You can change that. Preload, preloading your log, importing. You're importing application model, star, application component, star. What that means is whenever index.php loads, it's going to check main PHP for the config. And it's going to say, what am I loading? Well, this is what you're automatically loading. So you don't have to declare. It's just going to automatically load all the models and all the components. Remember, model is a representation of data and a component is a reusable class. Modules, there are different modules you can put in here. But your basic one, which is commented out, as you can see, is key. For this tutorial, just uncomment that out. And it says enter your password here. We're going to use the top secret password of, well, password. Don't ever use that. And when you do actually put your website into production, you're going to want to comment that back out. Why? G is a graphical interface that allows you to take a data table out of a database and convert that into web pages very quickly, very easily. We'll cover that in our CRUD tutorials. Some of these acronyms, CRUD, that just cracks me up. Anyways, components, you have the user component, which allows you to auto log in. That's cookie-based. And then you have an URL manager. So if you don't like the way it looks with this routing, you can actually change that. Database connections. For these tutorials, we'll be using MySQL. But it does support SQLite and a few other types. I think you actually have to use extensions for some of them. But we'll just be using MySQL because it's free and easy. So we're going to actually go ahead and comment this out. And our database is going to just be named Test. User name is going to be Test. And the password, as you guessed it, super secret password. Obviously, in a production-based system, you're going to want to set it up differently. And you're going to want to set it up for your actual username and password for whatever database system you're using. We will be using a few extra utilities that we'll cover in a few tutorials. Just be aware that database is going to be its own little tutorial. We're not going to get into SQL queries and things of that nature. I'm going to expect that you're going to come into these tutorials with that level of knowledge. But you may actually learn a few things if you're watching them in your brand new. Error handler. This gives you the path, site slash error, to the default error handler. This will be more sense when you talk about routing. But basically, it's the controller and the view. So if you collapse this down, controller, site, views. So you'll see site, and then there's error.php. So we'll talk about this more in depth in a model view controller framework tutorial that's coming up very soon. But basically, the controller routes and loads data. The view just presents it to the user. So the error.php, if you want to crack that open, that's your default error page. And you can see you got your error code and your error message, et cetera, et cetera. All right, your logging. Yee does have file-based logging built into it. It's actually a very handy feature. And the params. You can put custom parameters or variables in here. And you can see we have admin email as webmaster at example.com. So you can actually add in your own little parameters like your cat's name or your name or whatever you want. So this is Brian. Thank you for watching. I hope you found this educational and entertaining. Stay tuned. We're going to be working with database access in the next tutorial.