dimanche 15 février 2015

Call an action without any interaction

Is it possible to call an controller action without interaction within a template?


I want to convert a number to an specific string like this:



switch (s){
case 1: return "foo";
case 2: return "bar";
// ...
}


I want to do this in an each loop => each over items from my model, convert property s from each item to a specific string.


Well I probably could do this in an afterModel hook - but I would like to do it from the template.





Aucun commentaire:

Enregistrer un commentaire