On Wed, Dec 15, 2010 at 7:49 AM, Toby Corkindale <[email protected]> wrote:
> On 13 December 2010 21:07, Octavian Rasnita <[email protected]> wrote:
>> From: "Toby Corkindale" <[email protected]>
>>
...
>> True, but FormFu can also use Config::General code which is much clearer (or 
>> other config formats accepted by Config::Any).
>>
>> It would be OK if H::FH would allow creating custom elements and validators, 
>> filters... using Moose, but only generic elements, not related with any 
>> form, and then allow us to use configuration files for using those elements 
>> and constraints. It is not nice at all to need writing Perl code using Moose 
>> for just creating an HTML form, but each one with his preferences. :-)
>
>
>
> But you can do that if you want..
> If you're just doing simple stuff, like name-of-field + type-of-field,
> then you could do something like this:
>
>  my $form = HTML::FormHandler->new(
>    item => $c->model('DB::User')->find($id),
>    field_list => YAML::Load("form.yaml")
>  );

There is MooseX::SimpleConfig that is used by Catalyst itself and fits
here very well.  With some Moose coercions this is enough to build any
Moose object and it let's you use any config file format that is
supported by Config::Any.

If only the underlying  MooseX::ConfigFromFile was more actively maintained.


-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to