[Catalyst] C::C::FormBuilder + TT2
Juan Camacho
jc5826 at gmail.com
Thu Feb 22 22:23:13 GMT 2007
On 2/22/07, Ferruccio Zamuner <nonsolosoft at diff.org> wrote:
> Ferruccio Zamuner wrote:
> > Hi
> >
> > I'm using TTSite and it renders forms if I call from TT2 [%
> > form.render %], it doesn't when I try to construct custom form template.
> > What am I missing?
> >
> [% formbuilder.field.myfield.field %] is ok!
>
> > Another question about Catalyst and FormBuilder:
> > On latest FormBuilder version (3.05), it is possible:
> >
> > $form->new(template => {type => 'div'});
> >
> > Where I can add such argument for template attribute to
> > C::C::FormBuilder?
> According what I've read I need to create subclass C::C::FormBuilder to
> modify new.
> Is it right?
>
Your Controller should inherit from C:C:FormBuilder. Please provide
more information as to why you want to modify the constructor method
-- new. I'm assuming that's what you meant. Unless you are actually
extending the functionality of C:C:FormBuilder I wouldn't recommend
it.
>
> I've find a fix to avoid a warning in C::C::FormBuilder::Action.pm line 34:
> ---
> if (my $source = $self->_source($controller, $c) ) {
> $attr{source} = $source;
> }
>
> - s/^\.*/./; # XX workaround for CGI::FormBuilder::Source::File bug
> + s/^\.*/./ if $_;
> return CGI::FormBuilder->new( \%attr );
Thank you. But I beat you to it :) I already have that change checked
into the trunk.
Juan
More information about the Catalyst
mailing list