Wednesday, January 19, 2011

Help with CakePHP tutorial

Hello,

I am a complete newbie to PHP and especially CakePHP and am going
through a few tutorials I found online.

The one I'm having problems with is located here:
http://www.switchonthecode.com/tutorials/cakephp-using-helpers#comment-6644

I've followed all the steps verbatim but when I try to go to the page
to see the results it returns two error messages. The table headers
show up but no data.

Undefined variable: data [APP\views\products\index.ctp, line 14]

Invalid argument supplied for foreach() [APP\views\products\index.ctp,
line 14]

This is what my controller file looks like:

class ProductsController extends AppController
{
var $name = "Products";
var $helpers = array('Html');

function index()
{
$data = $this->Product->find('all');

$this->set('data', $data);
}
}

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate