i found someone write helper for that http://bakery.cakephp.org/articles/view/asset-mapper
i create some modification to support bottomscript and bottom codeblock (in case need script that load on the end of the page). also change asset rule action with regex filter. and sometimes we need to define a css files after one script, or a codeblock after other script and vice versa, or in other words the sequence is really important. so i also change the behaviour of rendering script/css/codeblock, the rendering will rendered follow the sequence of AssetRule defined in asset.map.config.php also change the location of asset rule to config/asset.map.config.php On Sat, Dec 12, 2009 at 2:23 AM, thomaus <tho...@saimiris.com> wrote: > The problem is that not all the pages will have the ame structure, > some will call header, some not, ... but yes it's feasible. > > This aid, I'd like to know how to share CSS and JS. > > On Dec 11, 7:57 pm, pomares <k...@gordonpomarescentre.com> wrote: > > How about creating a custom layout and calling it from the controller > > with: $this->layout = 'customlayout'; > > > > Here is a custom layout I wrote with a bunch of css and javascript > > calls: > > > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " > http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > > <html xmlns="http://www.w3.org/1999/xhtml"> > > <head> > > <?php echo $html->charset(); ?> > > <title><?php echo 'GPC Admin: '; ?><?php echo $title_for_layout; ?></ > > title> > > > > <?php > > echo $html->meta('icon'); > > > > echo $html->css('admin-staff-layout'); > > echo $html->css('admin-staff'); > > > > echo $html->css('SpryCollapsiblePanel'); > > echo $html->css('SpryTabbedPanels'); > > echo $html->css('SpryAccordion'); > > > > echo $javascript->link('SpryCollapsiblePanel'); > > echo $javascript->link('SpryTabbedPanels'); > > echo $javascript->link('SpryAccordion'); > > > > echo $javascript->link('prototype'); > > echo $javascript->link('scriptaculous'); > > > > echo $scripts_for_layout; > > ?> > > > > </head> > > <body> > > > > <?=$this->element('topnav')?> > > > > <div id="outerWrapper"> > > <div id="contentWrapper"> > > <div id="content"> > > <?php $session->flash(); ?> > > <?php echo $content_for_layout; ?> </div> > > </div> > > </div> > > </body> > > </html> > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > 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+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>For > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- Mukhamad Ikhsan +6281572181283 Y!id:ikhsan.only http://www.diodachi.com Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
<<attachment: asset_mapper.php>>
<<attachment: asset_packer.php>>
<<attachment: asset_rule.php>>
<<attachment: asset.map.config.php>>