Skip to main content

Professional CodeIgniter

Professional CodeIgniter

Thomas Myer

ISBN: 978-0-470-28245-8

Jul 2008

336 pages

Select type: Paperback

Product not available for purchase


If you’re a PHP developer, you can build Rails-like applications without learning a new language by following the hands-on tutorials in Professional CodeIgniter. In this book, find an overview of MVC and agile technologies, model and schema for products, helpers and libraries, Ajax and Scriptaculous, and explanations of the creation of applications like content management, blogs, and forums. Follow the step-by-step instructions for building and perfecting each application with CodeIgniter, and you will learn how to avoid everyday problems that other reference manuals don’t address.
1. Welcome to the MVC World.

2. Agile Methodologies and Approaches.

3. A 10,000 Foot View of CodeIgniter.

4. Creating the Main Web Site.

5. Building a Shopping Cart.

6. Creating a Dashboard.

7. Improving the Dashboard.

8. Last-Minute Upgrades.

9. Security and Performance.

10. Conclusion.

Claudias Kids
Additional Code for Book
ChapterPageDetailsDatePrint Run
60Error in Code
First code fragment:
$this->session->set_userdata('user_email'], $row->email);

should be:
$this->session->set_userdata('user_email', $row->email);

67Error in Book Code
$Q = $this->db->getwhere(products,$options,1);

should be:
$Q = $this->db->getwhere('products',$options,1);

This code is correct in the downloaded version.

487Error in Code
$home['mainf'] = $this->MProducts->getMainFeature();
$skip = $home['mainf']['id'];
$home['sidef'] = $this->MProducts->getRandomProducts(3,$skip);
$data['main'] = $this->load->view('home',$home,true);

should be:

$data['mainf'] = $this->MProducts->getMainFeature();
$skip = $data['mainf']['id'];
$data['sidef'] = $this->MProducts->getRandomProducts(3,$skip);
$data['main'] = 'home';

102Error in Code
the search() function contains this group of code:

if ($this->input->post('term')){
$search['results'] = $this->MProducts->search($this->input->post

The use of $search['results'] is incorrect, as it should be $data['results'] instead, like this:

if ($this->input->post('term')){
$data['results'] = $this->MProducts->search($this->input->post('term');

The code is correct in the downloadable zip archive.

110Error in Code
In function updateCart:

$prevname = $cart[$productid][?price?];

should be

$prevprice = $cart[$productid][?price?]

111Error in Code
In the following code:

function cart($productid){
if ($productid > 0){
$fullproduct = $this->MProducts->getProduct($productid);
redirect(‘welcome/product/’.$productid, ‘refresh’);
$data[‘title’] = “Claudia’s Kids | Shopping Cart”;
if (count($_SESSION[‘cart’]) == true){
$data[‘main’] = ‘’;
$nav[‘navlist’] = $this->MCats->getCategoriesNav();

$nav[‘navlist’] = $this->MCats->getCategoriesNav();

Should be

$data[‘navlist’] = $this->MCats->getCategoriesNav();