Yolabingo,
You can use cake's pr() command to do the same thing in the controller
with much less effort. Just do...
pr($this->data) and the first thing that appears in your view is the
data dump. Of course, your way allows you to dump the data into a
particular div tag if that is needed. Useful if you have a debug box
on the page. I also found it helpful to modify the pr() method so
that it's contained within a DIV tag that left justifies the text.
Sometimes pr() will print as centered text depending on the style of
the context it happens to be in.
On Apr 13, 12:21 pm, "yolabingo" <[EMAIL PROTECTED]> wrote:
> One thing that has helped me tremendously as I learn this framework is
> to print the contents of $this->params and/or $this->data when I'm
> working on a function/view and getting stuck. Just do something like
> this in your controller (at all points before a view might be
> rendered):
>
> set('currData', $this->data);
> set('currParams', $this->params);
>
> and add this to your view:
>
> <pre>
> <?php print_r($currData);
> print_r($currParams); ?>
> </pre>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---