Maypole::Model::CDBI::Plain
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@279
48953598-375a-da11-a14b-
00016c27c3ee
Revision history for Perl extension Maypole
Revision history for Perl extension Maypole
+2.05 Tue Oct 28 20:00:00 2004
+ - Fixed a bug in CGI::Maypole::parse_location() (Dave Howorth)
+ - Some fixes for Maypole::Config, Maypole::Model::Base and
+ Maypole::Model::CDBI::Plain (Dave Howorth)
+
2.04 Tue Oct 27 14:00:00 2004
- Fixed Apache::MVC version (Randal Schwartz)
- fixed template_args (Dave Howorth)
2.04 Tue Oct 27 14:00:00 2004
- Fixed Apache::MVC version (Randal Schwartz)
- fixed template_args (Dave Howorth)
use strict;
use warnings;
use strict;
use warnings;
use strict;
use warnings;
use strict;
use warnings;
sub run {
my $self = shift;
sub run {
my $self = shift;
my $loc = $self->{cgi}->url( -absolute => 1 );
no warnings 'uninitialized';
$self->{path} =~ s/^($loc)?\///;
my $loc = $self->{cgi}->url( -absolute => 1 );
no warnings 'uninitialized';
$self->{path} =~ s/^($loc)?\///;
+ $self->{path} .= '/' if $self->{path} eq $loc;
$self->parse_path;
$self->parse_args;
}
$self->parse_path;
$self->parse_args;
}
use Maypole::Config;
use Maypole::Constants;
use Maypole::Config;
use Maypole::Constants;
__PACKAGE__->mk_classdata($_) for qw( config init_done view_object );
__PACKAGE__->mk_accessors(
__PACKAGE__->mk_classdata($_) for qw( config init_done view_object );
__PACKAGE__->mk_accessors(
);
# Should only be modified by model.
);
# Should only be modified by model.
-__PACKAGE__->mk_ro_accessors(qw( classes tables table_to_class));
+__PACKAGE__->mk_ro_accessors(qw( classes tables));
Contains a list of all tables, if supported by model.
Contains a list of all tables, if supported by model.
-=head3 table_to_class
-
-A hash containing a table to class mapping, if supported by model.
-
=head3 template_root
This is where your application can find its templates.
=head3 template_root
This is where your application can find its templates.
-These are the tables that are public to your Maypole application.
-Defaults to all the tables in the database.
+This is a list of the tables that are public to your Maypole
+application. Defaults to all the tables in the database.
-These are the tables that Maypole should care about
+This is a hash of the public tables. It is populated automatically by
+Maypole from the list in display_tables and should not be changed.
Username to log into the database with.
Username to log into the database with.
+=head2 Adding additional configuration data
+
+If your modules need to store additional configuration data for their
+own use or to make available to templates, add a line like this to your
+module:
+
+ Maypole::Config->mk_accessors(qw(variable or variables));
+
+Care is needed to avoid conflicting variable names.
+
=head1 SEE ALSO
L<Maypole>
=head1 SEE ALSO
L<Maypole>
package Maypole::Model::CDBI::Plain;
use base 'Maypole::Model::CDBI';
package Maypole::Model::CDBI::Plain;
use base 'Maypole::Model::CDBI';
+Maypole::Config->mk_accessors(qw(table_to_class));
+
sub setup_database {
my ( $self, $config, $namespace, $classes ) = @_;
$config->{classes} = $classes;
sub setup_database {
my ( $self, $config, $namespace, $classes ) = @_;
$config->{classes} = $classes;