[html-formfu] PATCH: configurable forms directory.

Andreas Marienborg omega at palle.net
Sun May 13 14:15:27 GMT 2007


Attached is a svk patch for allowing the path 'root/forms' to be =

configured. I don't see a reason for having it under root, so I want it =

outside it, hence I would like to be able to configure it.

It also corrects something which I would call a small flaw, where it =

would append the extension only if you did not provide a filename, which =

would make the examples of the POD fail.


- andreas

-------------- next part --------------
=3D=3D=3D=3D Patch <form_root_config> level 1
Source: 4548d020-06a0-4b37-8aa3-720a432dc893:/local/html-formfu-trunk:2817 =
[local]
Target: ad6ea75e-0b29-0410-be19-adbfd45e731a:/trunk:209 [mirrored]
        (http://html-formfu.googlecode.com/svn/trunk)
Log:
 r2810 at am-mbook:  andremar | 2007-05-12 13:30:31 +0200
 local branch of html-formfu
 r2817 at am-mbook:  andremar | 2007-05-13 12:13:42 +0200
 made form_root configurable

=3D=3D=3D Catalyst-Controller-HTML-FormFu/lib/Catalyst/Controller/HTML/Form=
Fu.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- Catalyst-Controller-HTML-FormFu/lib/Catalyst/Controller/HTML/FormFu.pm	=
(revision 209)
+++ Catalyst-Controller-HTML-FormFu/lib/Catalyst/Controller/HTML/FormFu.pm	=
(patch form_root_config level 1)
@@ -49,6 +49,7 @@
         method_action =3D> "Catalyst::Controller::HTML::FormFu::Action::Me=
thod",
         constructor   =3D> {},
         config_file_ext =3D> '.yml',
+        form_root     =3D> $c->path_to('root', 'forms'),
     );
     =

     my %args =3D ( %defaults, %$parent_config, %$self_config );
=3D=3D=3D Catalyst-Controller-HTML-FormFu/lib/Catalyst/Controller/HTML/Form=
Fu/Action/Config.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- Catalyst-Controller-HTML-FormFu/lib/Catalyst/Controller/HTML/FormFu/Act=
ion/Config.pm	(revision 209)
+++ Catalyst-Controller-HTML-FormFu/lib/Catalyst/Controller/HTML/FormFu/Act=
ion/Config.pm	(patch form_root_config level 1)
@@ -21,14 +21,13 @@
     my @files =3D grep {length} split /\s+/, $self->{_attr_params}->[0] ||=
 '';
     =

     if ( !@files ) {
-        push @files, $self->reverse . $config->{config_file_ext};
+        push @files, $self->reverse ;
     }
     =

     for my $file (@files) {
         $c->log->debug( __PACKAGE__ ." searching for file '$file'" )
             if $c->debug;
-        =

-        $form->load_config_file( $c->path_to('root/forms', $file ) );
+        $form->load_config_file( $config->{form_root} . "/" . $file . $con=
fig->{config_file_ext} );
     }
     =

     $form->process( $c->request );


More information about the HTML-FormFu mailing list