As we continue to create views for our application, it will be smart for us to have some organization to make sure that we keep things nice and straightforward.
1. Create a folder called
user
inside theviews
directory.2. Move the existing
signup.php
view into this folder. The resulting directory structure will look similar to the following screenshot:3. We need to update
index.php
and let it know where to find the signup view that we just moved:get('/signup', function($app) { $app->render('user/signup'); });
We cleaned up our views
folder structure by creating a user
folder, into which we will put all of the views that relate to users. We then moved our existing signup.php
file into the user
folder and told our index.php
file where to find the user/signup.php
file. Notice that the route for the signup page, /signup
, hasn't changed at all.