Hello bakers,
I found a strange "behavior" of the javascript->codeBlock() in cake
1.2:
if you use such code in view :
<h2>test</h2>
<?php echo $javascript->codeBlock(); ?>
alert('test');
<?php echo $javascript->endBlock(); ?>
The view is empty, only the layout is shown, but this :
<?php echo $javascript("alert('test')"); ?> is ok
This also works :
<h2>test</h2>
<?php echo $javascript->cacheEvents(false, true); ?>
<?php echo $javascript->codeBlock(); ?>
alert('test');
<?php echo $javascript->endBlock(); ?>
But this does not :
<h2>test</h2>
<?php echo $javascript->cacheEvents(false, false); ?>
<?php echo $javascript->codeBlock(); ?>
alert('test');
<?php echo $javascript->endBlock(); ?>
I think the endBlock() code does an ob_getcontents, ob_clean and an
ob_start(), so loosing the content if the cacheEvent did not set the
$this->_cache (for the codeBlock).
I just wounder if this is normal behavior, meaning that a call to
cacheEvent must be done if the javascript is written between the block
markers ?
Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---