O'Reilly logo

Professional CodeIgniter® by Thomas Myer

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

8.2. Creating a Page Manager

Now that you understand Claudia's need for some simple page management (and to be clear, all she needs is a simple way to create and edit just a handful of pages), you can get started on the work. When creating a page manager, you need to keep several things in mind before you even start working.

  1. You're not trying to build a full-on content management system. There's no need to get wrapped up in issues like workflow, privileges, and other advanced criteria.

  2. You want to have an easy way to allow for WYSIWYG creation of HTML content. You'll likely be integrating some kind of online editor like TinyMCE or Xinha.

  3. Don't forget that at some point you also need to integrate with the Welcome controller and the public pages.

You will need to take this in stages. First comes the database table (which will hold all the data involved with individual pages), then the model, then the controller, then the admin pages (the views that users actually interact with), then integrating the WYSIWYG editor, and finally, making it work with the Welcome controller.

8.2.1. Creating the Database Table

First things first, and that means creating the database table. In true Agile form, take the most straightforward path and create a table called Pages. The Pages table should have a primary field called id (which is de rigueur), and fields for a page name/title, keywords, description, status, the page content, and a short path.

Of all of these fields, the path is the least transparent ...

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