jeudi 9 février 2017

Good practice of using variables with template

Vote count: 0

I have recently started to work with play framework and working on a simple web project right now.

I am dealing with HTML templates so far and now I want to move some static values somewhere (f.x. version of application, name of application)

I have found only 3 ways so far:

  1. Create java get/set object and pass it to template.
  2. Declare variables inside of template and use them.
  3. Add variables conf/application.conf

I do not like 1-st and 2-nd and would prefer to use 3-th way, however I do not want to mess with application.conf therefore I was thinking about new config file (like variables.conf or so) where I will save all static variables. I also want to make sure I can deal with i18n in future.

I would be very glad to see either a link where it is described or about todo-steps what needs to be done.

Thanks.

asked 20 secs ago

Let's block ads! (Why?)



Good practice of using variables with template

Aucun commentaire:

Enregistrer un commentaire