rythmengine / rythm-doc

Rythm Engine Documentation
Other
5 stars 5 forks source link

Passing one parameter by position #35

Open pavel-chumakou opened 8 years ago

pavel-chumakou commented 8 years ago

Please add to the documentation that you can't pass one parameter by position. I spent more than one hour trying to understand why my template produce NPE :)

Map<String, Source> sources = .....
Rythm.render("@args Map<String, Source> sources  .....",  sources);  // won't work
greenlaw110 commented 8 years ago

You can pass one parameter by position if your sources type is NOT a map. Passing one parameter of Map type means you want to pass parameters by name which is documented at http://rythmengine.org/doc/developer_guide.md#by_name