> - css - I want to include some css files only when I use Elements or
> helpers they are used by. Is it any way to do this in cakephp? Or have
> I include all css files into all pages?
>
I prefer to include all css scripts in the head. It has tow
advantages:

- The includes are made in one place in my layout, so it's easier to
add or remove
stylesheets (just add or remove the css include in a single file)

- The browsers use to cache all the files. Hence, if a user request a
page that
loads a lot of javascripts and css's, in the next request this
includes will be
cached and the request will be faster.


> - javascript - I have on-dom-ready js function in header and I want to
> add some script to it. I think I can do this by some kind of element
> filled from view but maybe there is a better way?

If the scripts are complex, put all scripts in a js file and include
it in the template.
If your scripts are little bocks of code, user the $javascript-
>codeBlock() method
for including your javascript where it is necesary.


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to