On Tue, Mar 17, 2009 at 12:41 PM, furionn <[email protected]> wrote:
>
> Element:
> =================================
> <?php
> $a = $this->requestAction('news/newsLeft');
> foreach ($a as $key => $val)
> {
>    echo $val['News']['short'];
> }
>
> //die('=================');
> ?>
>
> Problem is:
>
> if die(); commented out displays nothing
> else displays normal

That's because elements are parsed, then included into the view which,
in turn, is rolled into the layout. When die() is encountered,
processing stops before the view has been completed for display.

Think of it like a recipe: the layout is the serving plate, the view
is the type of pot used for cooking, the data are the ingredients, and
elements are ... more ingredients. If you reach in the cupboard for an
element and it tells you to stop cooking immediately, then you're not
going to end up with anything on your plate.

OK, that was a bit dumb but maybe it makes sense.

--~--~---------~--~----~------------~-------~--~----~
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