What is TODO List?

TODO List is a personal list of things that are to be done. This PHP application is created to highlight PHP features supported by NetBeans IDE.

This sample is not intented to be used on a production server without any changes.

This sample demonstrates the following features:

  • OOP concepts
  • preventing public access to your scripts
  • configuration your application
  • accessing your database data
  • changing your database data (with redirect-after-post pattern)
  • validating your data
  • splitting scripts and templates
  • handling expected and unexpected exceptions

Requirements

Follow these before you run the sample:
  • Install NetBeans IDE with PHP support
  • Install and configure PHP Runtime (PHP 5.4 or newer)

What is included?

  • NetBeans PHP Application Project
  • Database together with SQL Script
  • Additional Stylesheet, JavaScript

Before the start

  • If you want to try the sample out, follow Getting Started guidelines.
  • If you want to try debugging features of the NetBeans IDE, follow the Debugging guidelines.

Getting Started

  1. As a database, the application uses SQLite database with some sample data (see db directory).
  2. As a server, the application uses the PHP built-in web server.
  3. Run the project. Right-click the project node again and select Run Project or use the Run Project icon in the main menu toolbar. The sample PHP application should open in the Web browser.
  4. Play further with the sample. :)

Debugging

These steps should enable you the debugging option at the sample project, if you already have PHP debugger installed and configured.

  1. To debug the application, right-click the project node and select Debug Project or use the Debug Project icon in the main menu toolbar.
  2. Put breakpoint somewhere in any PHP script and (re)load the proper URL.
  3. Play further with the sample. :)

Project folder's structure

  • config - Contains configuration file config.ini where you can edit the DB connection settings.
  • dao - Contains DAO (Data Access Object) classes.
  • db - Contains the database and SQL dump for its creating.
  • exception - Contains custom exceptions.
  • layout - Contains layout common for all web pages.
  • mapping - Contains classes used for mapping from database to model classes.
  • model - Contains model classes.
  • page - Contains pages of the TodoList application.
  • util - Contains utility classes.
  • validation - Contains validation classes.
  • web - Contains publicly accessible files (PHP scripts, CSS, JS, images).