chrisl-921fb74d
chrisl-921fb74d

Reputation: 23100

Zend Framework contextually load stylesheets

Is it possible in Zend Framework to contextually autoload a stylesheet based on a unique identifier?

I'd like to load css based on the layout and the action name by first checking if the stylesheet exists then loading it.

Is that possible?

Upvotes: 2

Views: 76

Answers (1)

vascowhite
vascowhite

Reputation: 18440

Yes it is possible and surprisingly simple to implement. I have just started trying this for myself in a small project I am working on.

See Andy Baird's blog on this, which also includes the code you need to get you started. He continues it in a second blog which takes the concept slightly further.

He uses the same technique for both CSS and javascript files, so you may want to try it with both too.

Upvotes: 2

Related Questions