O'Reilly logo

Pro PHP and jQuery by Jason Lengstorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Add Controls to Create, Edit, and Delete Events

Now that the calendar can be viewed, you need to add controls that will allow administrators to create, edit, and delete events.

Generating a Form to Create or Edit Events

To edit an event or add new events to the calendar, you need to use a form. You do this by adding a method called displayForm() that generates a form for editing and creating events to the Calendar class.

This simple method accomplishes the following tasks:

  1. Checks for an integer passed as the event ID.

  2. Instantiates empty variables for the different fields used to describe events.

  3. Loads event data if an event ID was passed.

  4. Stores event data in the variables instantiated earlier if it exists.

  5. Outputs a form.

Note

By explicitly ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required