Professional CodeIgniter, Thomas Myer

Chapter 6: Creating a Dashboard
160
Figure 6-4

Now when an admin logs out, he or she should see an error message similar to the one pictured in
Figure 6 - 4 .

That ' s one bit of work that is out of the way. Now you can concentrate on the other parts of the admin tool.


Creating the Category Management Tools

In this section, you create all the pages that Claudia needs to manage categories. This involves adding
some new functions to the admin/categories controller, adding a handful of functions to the existing
MCats model, and creating three new views.


Creating the Category Home Page

The first step is creating the Category home page. In the admin/categories controller, create an
index()

function:
function index(){
$data[`title'] = "Manage Categories";
$data[`main'] = `admin_cat_home';
$data[`categories'] = $this-
>
MCats-
>
getAllCategories();
$this-
>
load-
>
vars($data);
$this-
>
load-
>
view(`dashboard');
}
c06.indd 160
c06.indd 160
6/10/08 5:36:01 PM
6/10/08 5:36:01 PM


Другие страницы

 
Cкачать книги бесплатно без регистрации в электронном виде (pdf, chm, txt).Вы можете читать книги онлайн на нашем сайте литературного портала книг.Большая подборка учебников, пособий, интересных книг.Электронные книги на английском языке скачать бесплатно без смс.