[html-formfu] some incompatible changes

Carl Franks fireartist at gmail.com
Fri Nov 23 22:19:38 GMT 2007


I've committed some changes that will require some changes to your applications.
$form->render() no longer returns an object - it now just returns a string.
All the HTML/FormFu/Render/* classes have been removed.

The only changes that most people will come across are that
render_class_args() has been removed and has been replaced by
tt_args()
and if you want to use Template::Alloy, then instead of setting:
    $form->render_class_args->{TEMPLATE_ALLOY} = 1;
you should set:
    $form->tt_module( 'Template::Alloy' );
(it defaults to 'Template')
This means you can now easily use Template::Alloy::XS if you wish, or
any other module with the same interface as TT.

Of course, if you're doing anything in your templates with the render
object - then this'll be the biggest thing that needs changed.
If for example, you had been doing: [% form.render.field('foo') %]
that would now have to be changed to: [% form.get_field('foo') %]
Diff the test files in "t/examples" for more details.

The main reason for these changes, is that the structure of the
Render/* classes was such that it would have been impracticable to
create new classes to output the form in different ways.
Now, we're going to be able to experiment with adding new rendering options.
At Brian's suggestion, I'm going to have a go at adding a non-template
renderer, which basically just builds the form from strings. - The
only reason for this, really, is performance - if it's not several
times faster than using TT, it probably won't be worth having to
maintain both that and the templates in sync.
This renderer would obviously only be useful for default output - that
doesn't require customised templates. - But I'll post more details
once I've had a go at this.

Carl



More information about the HTML-FormFu mailing list