[html-formfu] Include Catalyst::Controller::RequestToken in
C::C::HTML::FormFu
onken at houseofdesign.de
onken at houseofdesign.de
Tue Feb 10 21:47:06 GMT 2009
Hi,
I'm almost done with this.
But I have a problem with the Element::RequestToken I wrote.
It contains some accessors like "session_key" which I created with
__PACKAGE__->mk_item_accessors ( qw( session_key ) );
But I cannot set this value:
->elements({type => 'RequestToken', name => $self->field_name, session_key
=> $self->session_key });
The new constructor in Element::RequestToken looks like:
sub new {
my $self = shift->next::method(@_);
my %params = @_;
$self->session_key('__token');
return $self;
}
Which should set the default to "__token"
Any ideas why this does not get overwritten?
Thanks
moritz
On Fri, 16 Jan 2009 09:54:25 +0000, Carl Franks <fireartist at gmail.com>
wrote:
> 2009/1/16 <onken at houseofdesign.de>:
>>
>> seems like MultiForm doesn't support "plugins":
>
> Ok, just forget about Multiforms for now, and put the controller code
> into sub _form {}
>
>> So far I created a new Element::Token and Constraint::Token which is
>> attached to $form using Plugin::Token. Plugin::Token is set
automatically
>> if $config->{token_enable} is set. Plugin::Token does nothing else than
>> attaching Element::Token to $form. The logic is in Element::Token and
>> Constraint::Token.
>>
>> Do you think this is a sane approach?
>
> That sounds ok.
> Though, could you call them Element::RequestToken and
> Constraint::RequestToken, and config 'request_token_*' ?
> I've found with previous constraints, etc, that it's much easier to
> remember the names first time if they exactly match the modules they
> use / expand on.
> It's always more enjoyable to get things right first time, than to
> have to open up the docs to look up names.
>
> Cheers,
> Carl
>
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
More information about the HTML-FormFu
mailing list