From: ??????
Dear friends:
I read and follow http://www.catalystframework.org/calendar/2012/8
article, These code
-------------------------------------------------------
$c->request->params
-------------------------------------------------------
in controller Manage.pm, and
--------------------------------------------------------
write_file $database_file, { append => 1 },
"$id|$params->{first_name}|$params->{last_name}|$params->{email}\n";
----------------------------------------------------------
in model DB.pm, 'first_name' and 'last_name' can't get from database_file.txt
and two pm file.
What's the principle?
$c is so import and complex, how can I get it from formal pod document or
some special article such as http://www.catalystframework.org/calendar/2012/8?
Thanks a lot.
Thai Heng
Hi,
You need to read the serie of those 9 articles starting from the first one,
because each new step uses the code from the previous steps and just explain
the changes.
And please read Catalyst POD documentation on CPAN first.
The context variable $c is the second variable you can get in controllers
actions (after $self) like:
package MyApp::Controller::MyController;
use Moose;
use namespace::autoclean;
BEGIN {extends 'Catalyst::Controller'; }
sub my_action : Local {
my ( $self, $c ) = @_;
#Here you have the var $c
}
Octavian
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/