[html-formfu] Order of the elements in the form

Carl Franks fireartist at gmail.com
Thu Dec 10 12:24:46 GMT 2009


2009/12/10 Octavian Râşniţă <orasnita at gmail.com>:
> Hi,
>
> I have a form defined as:
>
> <elements>
> ...
> </elements>
>
> load_config_file admin/s/form.conf
>
> But the <elements> defined in this form appear *after* the elements defined
> in admin/s/form.conf.
>
> Is there a way to fix this issue?

You can only work around it.
populate() deliberately ensures load_config_file() is called before
elements(), constraints(), etc.

This only appears confusing when using config files, because you think
the config file has an order, whereas perl actually sees an unordered
hash-ref.

If you were using YAML, you could start a new stream with "---" to
ensure what followed was loaded seperately.
I don't know if Config::General has something similar.

If not, you could maybe do something like:
<elements>
...
<block>
load_config_file: admin/s/form.conf
</block>
</elements>
(or however Config::General works ;)

Otherwise you'll need to do something like:
<load_config_file>
elements.conf
admin.conf
</load_config_file>

Carl



More information about the HTML-FormFu mailing list