Catalyst-Model-FormFu

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

            called uri contains: /foo/bar/1

            # default_action_use_name => 1 leads to:
            $form->action = /foo/bar

            # default_action_use_path => 1 leads to:
            $form->action = /foo/bar/1

    context_stash
        To allow your form validation packages, etc, access to the catalyst
        context, a weakened reference of the context is copied into the
        form's stash.

            $form->stash->{context};

        This setting allows you to change the key name used in the form
        stash.

        Default value: "context"

    languages_from_context

lib/Catalyst/Model/FormFu.pm  view on Meta::CPAN

BEGIN {
  $Catalyst::Model::FormFu::VERSION = '0.004';
}

# ABSTRACT: Speedier interface to HTML::FormFu for Catalyst

use strict;
use warnings;
use HTML::FormFu;
use HTML::FormFu::Library;
use Scalar::Util qw(weaken);
use Moose;
use namespace::clean -except => 'meta';

extends 'Catalyst::Model';
with 'Catalyst::Component::InstancePerContext';

has model_stash             => ( is => 'ro', isa => 'HashRef' );
has constructor             => ( is => 'ro', isa => 'HashRef', default => sub { {} } );
has context_stash           => ( is => 'ro', isa => 'Str', default => 'context' );
has config_callback         => ( is => 'ro', isa => 'Bool', default => 1 );

lib/Catalyst/Model/FormFu.pm  view on Meta::CPAN

    my ($self, $c) = @_;

    my %args;

    # cache and query
    $args{cache} = $self->cache;
    $args{query} = $c->request;

    ### stash
    $args{stash}{$self->context_stash} = $c;
    weaken $args{stash}{$self->context_stash};
    $args{stash}{schema} = $c->model($self->model_stash->{schema}) if $self->model_stash;

    ### config_callback
    $args{config_callback}{plain_value} = sub
    {
        return unless defined $_;

        if ( /__uri_for\(/ )
        {
            s{__uri_for\((.+?)\)__}

lib/Catalyst/Model/FormFu.pm  view on Meta::CPAN


    # default_action_use_name => 1 leads to:
    $form->action = /foo/bar

    # default_action_use_path => 1 leads to:
    $form->action = /foo/bar/1

=item context_stash

To allow your form validation packages, etc, access to the catalyst context,
a weakened reference of the context is copied into the form's stash.

    $form->stash->{context};

This setting allows you to change the key name used in the form stash.

Default value: C<context>

=item languages_from_context

If you're using a L10N / I18N plugin such as L<Catalyst::Plugin::I18N> which



( run in 0.492 second using v1.01-cache-2.11-cpan-65fba6d93b7 )