Practical Example

To test what you have learned so far, let's create a few new pages for your new application — DVD Rental.

About Page

Create file templates/default/page/index.html and put some information inside about your application. You can use any HTML markup, but avoid using JavaScript just yet. The content of this page will be inserted into your Shared template.

Registration Page

We will also need to have a separate page for user registration. Create page/register.php.

To make things look nicer, let's use a custom template for registration. Define registratinon page like this:

As you can see I have created new page object, re-defined init() method and added form into the page. I also have added 2 fields and a submit button into the form.

To customize the look of the registration page, I am redefining defaultTemplate method. This method can be changed for any view and adding the following template file into templates/default/page/register.html:

After you've done this, find where Menu is added inside your Application class (lib/Frontend.php) and add new page to it using "addMenuItem":

Demo

With only that, your very basic web application is ready. Click here to try it out.

Conclusion

As I have promised - Agile Toolkit is the shortest path to a working Web Application in PHP. With a total number of roughly 60 lines we have deployed a nice and slick application. You have nearly explored about 5% of what Agile Toolkit has to offer. Next I'm going to introduce "Models" and how to connect your application with the database.