
orasnita at gmail
Nov 27, 2010, 3:44 AM
Post #4 of 4
(1123 views)
Permalink
|
Since Catalyst uses Moose, you can inspect the $c and $self objects using the meta() method of these objects. For example, you can print the methods provided by $c and $self, and their attributes using: sub methods : Local { my ($self, $c) = @_; my $body; $body .= $_->name . '<br>' for $c->meta->get_all_methods; $body .= $_->name . '<br>' for $c->meta->get_all_attributes; $c->res->body($body); } If you want to see the modules that provide these methods, you can also use $body .= $_->fully_qualified_name . '<br>' for $c->meta->get_all_methods; And the same thing for $self... Octavian ----- Original Message ----- From: "NGUYENHONGTHAI" <nguyenhongthaiptit [at] gmail> To: <catalyst-dev [at] lists> Sent: Tuesday, November 23, 2010 5:45 AM Subject: [Catalyst-dev] The lib of "my ($self, $c) = @_;" > Hi all! > In a subroutine of a controller, we always use this command: my ($self, $c) > = @_; > And then use some method of $self, $c, example: $c -> stash, $c -> forward. > How do I get all method of $c and $self (such as automatic complete of some > editor of another languages) > > Pls give a link or document to understand them. > > -- > Regards! > Nguyen Hong Thai > -------------------------------------------------------------------------------- > _______________________________________________ > Catalyst-dev mailing list > Catalyst-dev [at] lists > http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev > _______________________________________________ Catalyst-dev mailing list Catalyst-dev [at] lists http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
|