my design idea would be like sql transaction control.
This is how you "hack" helpers for additional features:
http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/
Now the result would look something like this:
Before:
<?php echo $html->css('cake.generic')?>
<?php echo $html->css('app.generic')?>
<?php echo $html->css('app.layout')?>
<?php echo $html->css('app.form')?>
After:
<?php $html->concatenateCss('begin', array('name' => 'all.css',
'maxBytes' => '8192', 'temporary' => false)?>
<?php $html->css('cake.generic')?>
<?php $html->css('app.generic')?>
<?php $html->css('app.layout')?>
<?php $html->css('app.form')?>
<?php $html->css('app.jquery')?>
<?php echo $html->concatenateCss('end')?>
If you want to keep the echos infront you could use
http://de.php.net/manual/en/function.ob-start.php,
http://de.php.net/manual/en/function.ob-get-contents.php and a class
variable inside of your modified function css() { }. Echo should
return false or null then:
<?php $html->concatenateCss('begin', array('name' => 'all.css',
'maxBytes' => '8192', 'temporary' => false)?>
<?php echo $html->css('cake.generic')?>
<?php echo $html->css('app.generic')?>
<?php echo $html->css('app.layout')?>
<?php echo $html->css('app.form')?>
<?php echo $html->css('app.jquery')?>
<?php echo $html->concatenateCss('end')?>
Same goes for $js or $javascript (whatever version you are on)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment