in your view which checks if that variable is null or not, and then
try to echo it...
On Sep 2, 4:05 pm, Richard <richard_j...@hotmail.com> wrote:
> 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 cake-php@googlegroups.com
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?hl=en
No comments:
Post a Comment