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 <?debug($products)?> in
your view.

HTH,

Pablo Viojo
[email protected]
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 <[email protected]> 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:
> <?php
>  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:
> <?php echo'hello';?>
>
> <html>
>  <head>
>  <title>test title</title>
>  </head>
>  <body>
>  <div id="container">
>  <div id="content">
> <?=$content_for_layout;?>
> <?php echo $product['Product']['id']; ?>
>  </div>
>  </div>
>  </body>
> </html>
>
> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to