A form system, jForms, is available in Jelix, but we will see it in a next chapter.
For the moment, we're going to see how to deal with forms in a "traditionnal"
way. We will manipulate ourselves submitted data etc, and we will create an HTML
form in order to record some new news.
===== The template and the urls =====
Initially, we will make the template, very simplified, that we store in the
@@news/template/newsform.tpl@@ file :
Creation of a news
Very classical, put aside the template tags @@{formurl}@@, @@{formurlparam}@@ and @@{jurl}@@.
In Jelix, you will avoid putting urls directly in the templates or the actions,
for ease of maintenance and evolution reasons. The URL system of Jelix enables
you to centralize all the urls in the urls.xml file (or urls.xml files inside modules).
The jUrl object and the tag @@{jurl}@@ enable you to obtain a URL by giving only
the name of the action and eventually the parameters.
So, for the "cancel" linkg, the generated url will be @@/index.php/news/default/index@@.
If you move the index.php in an other directory, or if you change the url
of the action into the urls.xml, you won't have to change your templates.
We could have used the tag @@{jurl}@@ also in @@E@