MasonX::Resolver::WidgetFactory - resolve paths to HTML::Widget::Factory plugins


MasonX-Resolver-WidgetFactory documentation  | view source Contained in the MasonX-Resolver-WidgetFactory distribution.

Index


NAME

Top

MasonX::Resolver::WidgetFactory - resolve paths to HTML::Widget::Factory plugins

VERSION

Top

version 0.008

SYNOPSIS

Top

  use MasonX::Resolver::WidgetFactory;

  my $res = MasonX::Resolver::WidgetFactory->new(
    factory => My::Widget::Factory->new,
    prefix => '/widget',
  );

  my $interp = HTML::Mason::Interp->new(
    resolver => $res,
    # ... other options ...
  );

DESCRIPTION

Top

This Resolver exposes the plugins of a HTML::Widget::Factory object as virtual components under a given prefix.

For example:

  my $res = MasonX::Resolver::WidgetFactory->new(
    prefix => '/widget',
  );

  # elsewhere:

  <& /widget/select, name => "myselect", options => \@options &>

The component call to /widget/select is translated to $factory->select(...arguments...).

Among other things, this means that you can use component-with-content calls, which may be easier in some situations:

  <&| /widget/button &>
  This is normal mason content, including <% $various_interpolations %>
  and other <& /component/calls &>
  </&>

prefix

The component path root under which to respond.

factory

The HTML::Widget::Factory object to use. Defaults to a new HTML::Widget::Factory object.

strict

Boolean. If false (the default), the resolver will return false when asked to resolve a path that does not correspond to a widget provided by the factory. If true, it will die instead.

AUTHOR

Top

Hans Dieter Pearcey, <hdp at pobox.com>

COPYRIGHT AND LICENSE

Top


MasonX-Resolver-WidgetFactory documentation  | view source Contained in the MasonX-Resolver-WidgetFactory distribution.