If the element is being rendered in the layout, why not add the $html-
>css to the header as normal in the layout?

Is the element optional in the layout? ie. is it only displayed on
some pages and not others?

If so, I think the minor overhead of including the CSS on every page
(and therefore cached by the browser) would outway the overhead of
using an additional helper.


On Jan 27, 2:58 pm, Gonzalo Servat <gser...@gmail.com> wrote:
> On Tue, Jan 27, 2009 at 12:51 PM, RichardAtHome 
> <richardath...@gmail.com>wrote:
>
>
>
> > Try it from a layout.
>
> > ...but your question is about calling it from inside an element :-S
>
> > ... or do you mean an element that's linked from a layout and not a
> > view?
>
> Right! An element called from a layout that has a call to $html->css() in it
> (with inline set to false). Like I said, the way I fixed it was by creating
> a helper which I call from the element to add the custom CSS file and called
> from the layout inside the <head></head> section to print it out.
>
> - 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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to