Re: view not echoing
On Sun, Jun 21, 2009 at 1:20 PM, dflow wrote: > > i have done some tutorials > the scaffold works fine > > when i want to create my own view > nothing is echoed here is the controller: > class ProductsController extends AppController { > var $name = 'Products'; > > //var $scaffold; > function index() { > $this->set('products',$this->Product->find('all')); > } > } > ?> > > and the products/index.ctp view > > i get the hello and nothing blank screen with the default > cake layout > the code: > > > > > test title > > > > > > > > > > > That looks more like a layout than a view. It should be like: // view file -- index.ctp: // layout file -- default.ctp test title --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: view not echoing
try it! debug($products); Saludos, Pablo Viojo pvi...@gmail.com http://pviojo.net (#260 y creciendo!) Ayudar nos hace felices! http://needish.com - http://helperman.org On Mon, Jun 22, 2009 at 4:53 AM, dflow wrote: > > i get > > the hello echo > and underneath > Array > what should i see with the debug? > > On Jun 22, 7:59 am, Pablo Viojo wrote: > > debug(...) is your friend! always! > > Saludos, > > > > Pablo Viojo > > pvi...@gmail.comhttp://pviojo.net > > (#260 y creciendo!) > > > > > > Ayudar nos hace felices!http://needish.com -http://helperman.org > > > > On Sun, Jun 21, 2009 at 6:23 PM, Miles J > wrote: > > > > > Because Product does not exist. > > > > > Its $products[0]['Product']; > > > > > Its a multi array. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: view not echoing
i get the hello echo and underneath Array what should i see with the debug? On Jun 22, 7:59 am, Pablo Viojo wrote: > debug(...) is your friend! always! > Saludos, > > Pablo Viojo > pvi...@gmail.comhttp://pviojo.net > (#260 y creciendo!) > > > Ayudar nos hace felices!http://needish.com -http://helperman.org > > On Sun, Jun 21, 2009 at 6:23 PM, Miles J wrote: > > > Because Product does not exist. > > > Its $products[0]['Product']; > > > Its a multi array. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: view not echoing
debug(...) is your friend! always! Saludos, Pablo Viojo pvi...@gmail.com http://pviojo.net (#260 y creciendo!) Ayudar nos hace felices! http://needish.com - http://helperman.org On Sun, Jun 21, 2009 at 6:23 PM, Miles J wrote: > > Because Product does not exist. > > Its $products[0]['Product']; > > Its a multi array. > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: view not echoing
Because Product does not exist. Its $products[0]['Product']; Its a multi array. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: view not echoing
i still get the error undefined index: Product [APP\views\products\index.ctp, line 12] On Jun 21, 8:24 pm, Pablo Viojo wrote: > The problem isn't related to "echo". Your variable is name products in the > controller > $this->set('products',$this->Product->find('all')); > > So, in the view you should use $products. Try doing in > your view. > > HTH, > > Pablo Viojo > pvi...@gmail.comhttp://pviojo.net > (#260 y creciendo!) > > > Ayudar nos hace felices!http://needish.com -http://helperman.org > > On Sun, Jun 21, 2009 at 1:20 PM, dflow wrote: > > > i have done some tutorials > > the scaffold works fine > > > when i want to create my own view > > nothing is echoed here is the controller: > > > class ProductsController extends AppController { > > var $name = 'Products'; > > > //var $scaffold; > > function index() { > > $this->set('products',$this->Product->find('all')); > > } > > } > > ?> > > > and the products/index.ctp view > > > i get the hello and nothing blank screen with the default > > cake layout > > the code: > > > > > > > > > test title > > > > > > > > > > > > > > > > > > > > > > > i get this error > > Notice (8): Undefined variable: product [APP\views\products\index.ctp, > > line 11] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: view not echoing
The problem isn't related to "echo". Your variable is name products in the controller $this->set('products',$this->Product->find('all')); So, in the view you should use $products. Try doing in your view. HTH, Pablo Viojo pvi...@gmail.com http://pviojo.net (#260 y creciendo!) Ayudar nos hace felices! http://needish.com - http://helperman.org On Sun, Jun 21, 2009 at 1:20 PM, dflow wrote: > > i have done some tutorials > the scaffold works fine > > when i want to create my own view > nothing is echoed here is the controller: > class ProductsController extends AppController { > var $name = 'Products'; > > //var $scaffold; > function index() { > $this->set('products',$this->Product->find('all')); > } > } > ?> > > and the products/index.ctp view > > i get the hello and nothing blank screen with the default > cake layout > the code: > > > > > test title > > > > > > > > > > > > i get this error > Notice (8): Undefined variable: product [APP\views\products\index.ctp, > line 11] > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
view not echoing
i have done some tutorials the scaffold works fine when i want to create my own view nothing is echoed here is the controller: set('products',$this->Product->find('all')); } } ?> and the products/index.ctp view i get the hello and nothing blank screen with the default cake layout the code: test title i get this error Notice (8): Undefined variable: product [APP\views\products\index.ctp, line 11] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---