[Catalyst] Catalyst::Controller::BindLex RECIPE for :Param

Michael Reece mreece at vinq.com
Tue Jan 2 18:47:37 GMT 2007


i am trying to follow the recipe mentioned here:

http://search.cpan.org/~nuffin/Catalyst-Controller-BindLex-0.03/lib/ 
Catalyst/Controller/BindLex.pm#RECIPES

     __PACKAGE__->config->{bindlex}{Param} => sub { $_[0]->req- 
 >params };

after the obvious s/=>/=/, i put this line in MyApp/Controller.pm  
(the base class for all my controllers).

   package MyApp::Controller;
   use base qw/Catalyst::Controller::BindLex/;

   __PACKAGE__->config->{bindlex}{Param} = sub { $_[0]->req->params };

however, i wonder if the base controller is not the right place for  
this, or if anyone has successfully managed to implement this recipe.

after restarting my app, what used to be

[debug] Loaded Path actions:
.------------------------------------- 
+--------------------------------------.
| Path                                |  
Private                              |
+------------------------------------- 
+--------------------------------------+
| /                                   | / 
index                               |
| /admin/index                        | /admin/ 
index                         |
| /area_overview                      | /area_overview/ 
index                 |
| /captcha                            | /captcha/ 
index                       |
| /captcha/image                      | /captcha/ 
image                       |
| /catalyst                           | / 
catalyst                            |
| /error/bad_conf_name                | /error/ 
bad_conf_name                 |
| /error/dump                         | /error/ 
dump                          |
| /error/no_conf_name                 | /error/ 
no_conf_name                  |
| /headerimage                        | /headerimage/ 
default                 |
| /headerimage                        | /headerimage/ 
index                   |
[..snip..]

becomes

[debug] Loaded Path actions:
.------------------------------------- 
+--------------------------------------.
| Path                                |  
Private                              |
+------------------------------------- 
+--------------------------------------+
| /                                   | / 
index                               |
| /                                   | / 
index                               |
| /                                   | / 
index                               |
| /                                   | / 
default                             |
| /                                   | / 
index                               |
| /bad_conf_name                      | / 
bad_conf_name                       |
| /catalyst                           | / 
catalyst                            |
| /dump                               | / 
dump                                |
| /image                              | / 
image                               |
| /index                              | / 
index                               |
[..snip..]

which is decidedly not right.

other controllers below this list are mapped the same before and  
after, but these are not.

any ideas?  thx.




More information about the Catalyst mailing list