[Catalyst-dev] improved behaviour for c->model and c->view

Bogdan Lucaciu bogdan at wiz.ro
Wed Sep 27 16:41:27 CEST 2006


The behaviour , as I described it in the POD:

for $c->model
+If the name is omitted, it will look for 
+ - a model object in $c->stash{current_model_instance}, then
+ - a model name in $c->stash->{current_model}, then
+ - a config setting 'default_model', or
+ - check if there is only one model, and return it if that's the case.

for $c->view
+If the name is omitted, it will look for 
+ - a view object in $c->stash{current_view_instance}, then
+ - a view name in $c->stash->{current_view}, then
+ - a config setting 'default_view', or
+ - check if there is only one view, and return it if that's the case.
 
there is also an improvement for default_* , you can now just specify
the view/model name (TT), there's no need for the full component name
anymore (View::TT) 

Tests to support both the new and the existing behaviour.

Bogdan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: current_view.patch
Type: text/x-patch
Size: 3865 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst-dev/attachments/20060927/aab8ae52/attachment.bin 


More information about the Catalyst-dev mailing list