CatalystX::Usul::Model - Interface model base class
0.7.$Revision: 1181 $
package CatalystX::Usul; use parent qw(CatalystX::Usul::Base CatalystX::Usul::File); package CatalystX::Usul::Model; use parent qw(Catalyst::Model CatalystX::Usul CatalystX::Usul::IPC); package YourApp::Model::YourModel; use parent qw(CatalystX::Usul::Model);
Common core interface model methods
Defines the following accessors:
Boolean used by "query_array" and "query_value" to determine if input value should be cleaned of potentially dangerous characters
List of characters to scrub from input values. Defaults to '"/\;
Loads model plugins including;
Calls "build_per_context_instance" for each new context
Called by "ACCEPT_CONTEXT". Takes a copy of the Catalyst object so that we don't have to pass $c->stash into "loc" in CatalystX::Usul
$c->stash
$self->check_field( $id, $val );
Expose "check_field" in Data::Validation
$self->check_form( \%fields );
Expose "check_form" in Data::Validation
$self->form( @rest );
Calls the form method to stuff the stash with the data for the requested form. Uses the $c->stash->{form}->{name} value to construct the method name
$c->stash->{form}->{name}
$local_text = $self->loc( $key, $args );
Localizes the message. Calls "loc" in CatalystX::Usul
$array_ref = $self->query_array( $attr );
Returns the requested parameter in a list context. Uses the encoding attribute to generate the method call to decode the input values. The decode method is provided by CatalystX::Usul::Encoding. Will try to guess the encoding if one is not provided
$scalar_value = $self->query_value( $attr );
Returns the requested parameter in a scalar context. Uses encoding attribute to generate the method call to decode the input value. The decode method is provided by CatalystX::Usul::Encoding. Will try to guess the encoding if one is not provided
$hash_ref = $self->query_value_by_fields( @fields );
Returns a hash_ref of fields and their values if the values are defined by the request. Calls "query_value" for each of supplied fields
$value = $self->scrub( $value );
Removes the $self->scrub_chars from the value
$self->scrub_chars
my $array_ref = $self->_get_req_array( $attr );
Takes a request object that must implement a params method which returns a hash ref. The method returns the value for $attr from that hash. This method will always return a array ref. This method is wrapped by "mk_encoding_methods" in Catalystx::Usul::Encoding and as such is not called directly
params
$attr
my $value = $self->_get_req_value( $attr );
Takes a request object that must implement a params method which returns a hash ref. The method returns the value for $attr from that hash. This method will always return a scalar. This method is wrapped by "mk_encoding_methods" in Catalystx::Usul::Encoding and as such is not called directly
None
There are no known incompatibilities in this module.
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <Support at RoxSoft.co.uk>
<Support at RoxSoft.co.uk>
Copyright (c) 2008-2009 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install CatalystX::Usul, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::Usul
CPAN shell
perl -MCPAN -e shell install CatalystX::Usul
For more information on module installation, please visit the detailed CPAN module installation guide.