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:

  • Checks for an integer passed as the event ID.
  • Instantiates empty variables for the different fields used to describe events.
  • Loads event data if an event ID was ...

Get Pro PHP and jQuery, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.