Friday, March 29, 2013

How to render a CSS/JS files with a version parameter?

Hello guys,
I need help to solve the following problem:

using:
echo $ this-> Html-> css (array ('forms', 'tables', 'menu'));

is rendered:
<link rel="stylesheet" type="text/css" href="/css/forms.css" />
<link rel="stylesheet" type="text/css" href="/css/tables.css" />
<link rel="stylesheet" type="text/css" href="/css/menu.css" />

However, in cases, I will need to sequence the css and js files to make a versioning and avoid a possible cache in case of changes. I need outputs like:
<link rel="stylesheet" type="text/css" href="/css/forms.css?seq=1.2.3" />
<link rel="stylesheet" type="text/css" href="/css/tables.css?ver=20130329.1" />
<link rel="stylesheet" type="text/css" href="/css/menu.css?NoCacheAndNoPragmaNoCache=12345" />

How would I do this via html helper?

*I'm trainig my english

Many thks,
Fabrício

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: