Hello all,

somehow I can't get the pagescontroller to pass a variable to the
view.

I have in my pages_controller.php:

class PagesController extends AppController {
        //some code cut out for better reading here

        var $uses = array('Category');

        function display() {

                //some code cut out for better reading here

                $this->set('categories', $this->Category-
>find('list'));
        }

And in my home.ctp I use just this:
<?php echo $categories; ?>

This returns:
Undefined variable: categories
(from the debug info I can see that PagesController->display() is
used)

When using debug($this->viewVars); I get this:

Array
(
    [page] => home
    [subpage] =>
    [title_for_layout] => Home
)

Can somebody give me advise on what to do?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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