[Catalyst] Listing all actions in app

Peter Flanigan pjf at roxsoft.co.uk
Thu Feb 16 18:50:05 GMT 2012


On 16/02/12 17:34, Paolo Gianrossi wrote:
> I have an app and I would like to be able to list (in a <select>, but
> whatever), all public actions in all controllers of my app.

Something like

   my $ns = $c->action->namespace;

   for my $container ($c->dispatcher->get_containers( $ns )) {
      for my $action (values %{ $container->actions }) {
         exists $action->attributes->{ 'Public' } or next;
         # Do something with $action->name
      }
   }

-- 

Regards



More information about the Catalyst mailing list