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
==== 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:
[EMAIL PROTECTED]: andremar | 2007-05-12 13:30:31 +0200
local branch of html-formfu
[EMAIL PROTECTED]: andremar | 2007-05-13 12:13:42 +0200
made form_root configurable
=== Catalyst-Controller-HTML-FormFu/lib/Catalyst/Controller/HTML/FormFu.pm
==================================================================
--- 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 => "Catalyst::Controller::HTML::FormFu::Action::Method",
constructor => {},
config_file_ext => '.yml',
+ form_root => $c->path_to('root', 'forms'),
);
my %args = ( %defaults, %$parent_config, %$self_config );
===
Catalyst-Controller-HTML-FormFu/lib/Catalyst/Controller/HTML/FormFu/Action/Config.pm
==================================================================
---
Catalyst-Controller-HTML-FormFu/lib/Catalyst/Controller/HTML/FormFu/Action/Config.pm
(revision 209)
+++
Catalyst-Controller-HTML-FormFu/lib/Catalyst/Controller/HTML/FormFu/Action/Config.pm
(patch form_root_config level 1)
@@ -21,14 +21,13 @@
my @files = grep {length} split /\s+/, $self->{_attr_params}->[0] || '';
if ( [EMAIL PROTECTED] ) {
- 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 .
$config->{config_file_ext} );
}
$form->process( $c->request );
_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu