Adm <linuxloverstaff <at> gmail.com> writes:
hello,
I'd like to do thinks in the better way...then:
I have to made an extension similar to BoilerTemplate.
Right now I made a special page and I'd like to put in a form to let
user choose a teplate.
Some questions:
1) Must I use some apis to render the form?
2) How to set the form target? Hidden input tags are a good solution
but: how can I have a clean urls ready form?
I'm ready to read any tutorial you can suggest me,
thanks for your attenction,
ADM
The HTMLForm Class [1] is very useful to build forms on MW.
It is directly used by most core forms (Preferences, Upload, Block...).
It will most probably suit your needs, if it doesn't, I advise extending it.
There's a documentation [2] and a tutorial [3] on
mw.org.
There is also FormSpecialPage [4] extending SpecialPage with build-in HTMLForm.
I never used that, but perhaps it is the abstraction level you're looking for.
I might not understand question 2) very well:
HTMLForm has it's own way to set the target, using
$htmlForm->setTitle($this->getTitle()); #in the case of a SpecialPage.
Targeting another SpecialPage is very complicated, although not impossible.
Targeting the same SpecialPage is probably easier for the developer AND the user.
[1] Path: /includes/HTMLForm.php
[2] Introduction:
http://www.mediawiki.org/wiki/HTMLForm
[3] Tutorial:
http://www.mediawiki.org/wiki/HTMLForm/tutorial
[4] Path to FormSpecialPage class: /includes/SpecialPage.php
--
Clément Dietschy
Seizam Sàrl.
24, rue de Bâle
68300 Saint-Louis (France)
tél. +33 6 87 75 99 27
www.seizam.com