into the header:
view.ctp
<?php echo $this->element("test") ?>
elements\test.ctp
<?php echo $html->css("test", array(), null, false) ?>
I'm using the latest stable build of Cake
On Jan 26, 11:33 am, Gonzalo Servat <gser...@gmail.com> wrote:
> On Mon, Jan 26, 2009 at 9:24 AM, RichardAtHome <richardath...@gmail.com>wrote:
>
>
>
> > Syntax should be:
>
> > echo $html->css( 'right_column', array( 'media' => 'screen' ), null,
> > false );
>
> Not if you're using the last parameter as "false". It just adds it to an
> array which later gets printed in the $scripts_for_layout section so there's
> no need to print it out.
>
> That wasn't the problem though. After speaking with AD7six, basically what
> happens is that the head scripts section is already processed by the time it
> gets to the elements in the layout so I can't use that array unless I want
> to re-work the order in which things are processed in CakePHP (which would
> surely break lots of other stuff). What I had to do was create a head helper
> (AD7six's suggestion) which I would call to add CSS (from the element) and
> later get the CSS (from the layout in the head section).
>
> If anyone wants to see an example of how to include a custom CSS file from
> an element, let me know and I'll do a quick blog on it.
>
> - Gonzalo
--~--~---------~--~----~------------~-------~--~----~
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