I have done some thing interesting to cop this in Zend Framework , Similar can be done in any of MVC systems if views and control code is differentiated.
1) Create a view file at application/views/index/include_js_vars.phtml and paste following code in this file.
2) now most probably you are including java scripts in your layout file application/layouts/scripts/layout.phtml
so render our include_js_vars view before [ echo…
View original post 124 more words