![]()
The Scriptaculous effects are easy to implement in CakePHP. I looked around for a simple example and didn’t find one, so here you go!
<?php echo $html->link('Dinner Menu','#',array('onclick'=>'Effect.toggle("dinnerMenu", "blind", {duration: 0.2}); return false;')); ?>
<dl id=”dinnerMenu” style=”display:none;”>
<?php foreach ($event['Meal'] as $meal): ?>
<dt><?php echo $meal['name']; ?></dt>
<dd><?php echo $meal['description']?></dd>
<?php endforeach; ?>
</dl>
Make sure to download the appropriate libraries to your /app/webroot/js/ directory and reference them in your layout file.
<?php
if(isset($javascript)):
echo $javascript->link('prototype.js');
echo $javascript->link('scriptaculous.js?load=effects');
endif;
?>
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment