On Dec 18, 2010, at 09:18, Steve Mallett wrote:
> So I added that to the tasks_controller.php:
> function index() {
> $this->Task->recursive = 1;
> $this->set('tasks', $this->paginate());
> $projects = $this->Task->Project->find('list'); // HERE
> }
Ok, you defined a new local variable $projects, which then immediately went out
of scope at the end of the index() method and died.
> To test I added <?php debug($projects); ?> to views/task/index.ctp
> but get error:
>
> Notice (8): Undefined variable: projects [APP/views/tasks/index.ctp, line 5]
If you want a variable available in the view, you have to use $this->set() to
put it there, as you did on the line above to set the $tasks variable in the
view.
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