Professional CodeIgniter

(singke) #1

Chapter 6: Creating a Dashboard


147


Claudia seems to approve, and you ask her to send in her notes on the conversation you ’ ve just had. She
smiles knowingly and shows off her detailed notes. “ I ’ ve learned something from the first go - around, ”
she says.

By the time you get back to your office, you have an e - mail containing a list of all the topics you covered
in the meeting. It ’ s time to create a sprint backlog.

Creating a Sprint Backlog


Because it ’ s time for a new sprint, it ’ s time to create a new backlog for it. Based on your conversation
with Claudia, you come up with the following backlog:


  1. Create a series of admin controllers (in their own folder).

  2. Secure those controllers and build a login form on the public side.

  3. Create a new model for admin users.

  4. Create controllers and views to administer those users.

  5. Expand, as needed, the models for orders, products, and categories.

  6. Create a dashboard view.

  7. Create CRUD (create, review, update, delete) screens for products and categories.

  8. Create import and export functions for products and categories.

  9. Add an easy way to assign products to categories and groups in batch mode.


There ’ s a lot to do, but now that you understand how models, views, and controllers work, there isn ’ t
anything too complicated about any of it.

The first step is creating a secure set of controllers, a model for users, and a login form to access it all.

Creating a Rudimentary Admin Framework


One of the great things about CodeIgniter controllers is that they can be organized into folders. This
adds only one more URI segment to your activity but keeps related controllers together. In the following
sections, you build out some administrative controllers related to orders, products, categories, and
admin users, all of which reside in a folder called admin.

This way, once a user logs in, he will be directed to work in the admin/products controller or the
admin/categories controller (depending on his task), and each set of controller tasks can be kept separate
and organized.

The best thing about this arrangement is that you can continue to work with the same models as before,
extending them as needed (although you ’ ll find that many of the models you wrote for the public side of
the site are just as useful in the admin context).
Free download pdf