php class that auto attaches .js and .css files, possible?

Posted by Haroldo on Stack Overflow See other posts from Stack Overflow or by Haroldo
Published on 2010-04-23T08:04:04Z Indexed on 2010/04/23 8:33 UTC
Read the original article Hit count: 178

Filed under:

I want the class to auto-attach its required css and js files when instantiated...

  1. is there any way of a class knowing where it is (and its files) in relation to the root?

  2. if 1 is possible, is there a way to check if a css/js file has already been referenced in the file, or is this not necessary(do browsers ignore duplicate css/js file references)?

© Stack Overflow or respective owner

Related posts about php