Professional CodeIgniter, Thomas Myer

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.
c06.indd 170
c06.indd 170
6/10/08 5:36:05 PM
6/10/08 5:36:05 PM


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

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