Professional CodeIgniter

(singke) #1

Chapter 6: Creating a Dashboard


170


echo “ < td align=’center’ > ”;
echo anchor(‘admin/products/edit/’.$list[‘id’],’edit’);
echo “ | “;
echo anchor(‘admin/products/delete/’.$list[‘id’],’delete’);
echo “ < /td > \n”;
echo “ < /tr > \n”;
}
echo “ < /table > ”;
}
? >

Without a lot of effort, then, you ’ ve created a product index page that replicates the functionality of the
category index page. You should have something that looks somewhat like Figure 6 - 9.

Figure 6-9

Creating the Product Create Page


The create() function of the admin/products controller is structurally similar to the create() function
of the admin/categories controller. First, check for incoming POST data. If they exist, add the record to the
database with an addProduct() model function, and return the user to the product home page.
Free download pdf