kelkoon has asked for the wisdom of the Perl Monks concerning the following question:
This code is the Application:use warnings; use strict; use CGI::Application::Server; use lib 'lib'; use Shop; use CGI::Application::Dispatch; CGI::Application::Dispatch->dispatch(); sub dispatch_args { return { prefix => '', table => [ '' => { app => 'Shop', rm => 'products' }, ':app/:rm' => { }, 'admin/:app/:rm' => { prefix => 'MyApp::Admin' }, ], }; } my $app = Shop->new(PARAMS => { }); my $server = CGI::Application::Server->new(); #$server->document_root('./t/www'); $server->entry_points({ '/index.cgi' => $app, }); $server->run;
Can you find what i'm missing? Thank you, Kelkoon# In "Shop.pm"... package Shop; use base 'Titanium'; sub setup { my $c = shift; $c->start_mode('families'); $c->error_mode('fallo'); $c->run_modes([qw/ families products fallo /]); } sub families { my $c = shift; my $errs = shift; my $plantilla = $c->load_tmpl; $plantilla->param( TITULO_PAGINA => 'titulo', CUERPO_PAGINA => 'cuerpo', ); return $plantilla->output; } sub products { my $c = shift; my $plantilla = $c->load_tmpl; $plantilla->param( TITULO_PAGINA => 'olutit', CUERPO_PAGINA => 'opreuc', ); return $plantilla->output; } sub fallo { my $c = shift; my $plantilla = $c->load_tmpl; $plantilla->param( TITULO_PAGINA => 'FALLO fallo FALLO', CUERPO_PAGINA => 'error ERROR error', ); } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Titanium problem
by Anonymous Monk on Apr 14, 2010 at 07:26 UTC | |
by kelkoon (Initiate) on Apr 14, 2010 at 07:48 UTC | |
by Anonymous Monk on Apr 14, 2010 at 08:01 UTC | |
by kelkoon (Initiate) on Apr 14, 2010 at 17:23 UTC |