[Catalyst-commits] r8017 -
trunk/Catalyst-Engine-Wx/lib/Catalyst/View
eriam at dev.catalyst.perl.org
eriam at dev.catalyst.perl.org
Fri Jun 27 16:23:42 BST 2008
Author: eriam
Date: 2008-06-27 16:23:42 +0100 (Fri, 27 Jun 2008)
New Revision: 8017
Modified:
trunk/Catalyst-Engine-Wx/lib/Catalyst/View/Wx.pm
Log:
Still changed the way the view deals with classes and methods.
Modified: trunk/Catalyst-Engine-Wx/lib/Catalyst/View/Wx.pm
===================================================================
--- trunk/Catalyst-Engine-Wx/lib/Catalyst/View/Wx.pm 2008-06-27 15:22:39 UTC (rev 8016)
+++ trunk/Catalyst-Engine-Wx/lib/Catalyst/View/Wx.pm 2008-06-27 15:23:42 UTC (rev 8017)
@@ -36,7 +36,7 @@
sub process {
my ($self, $c) = @_;
-
+
$c->stash->{'_displayed'} ||= 0;
if ($c->stash->{'_displayed'} != 1) {
@@ -48,23 +48,21 @@
my $code;
$module =~ s/\//::/g if $module =~ /\//;
-
- if (ref($module) eq 'ARRAY') {
- my $tmpmodule = shift(@{$module});
- $method = shift(@{$module});
- $module = $tmpmodule;
- }
- elsif ($module =~ /->/) {
- ($module, $method) = split (/->/, $module);
- }
- elsif ($module =~ /::/) {
- my (@module_name) = split (/::/, $module);
- $method = pop @module_name;
- $module = join ('::', @module_name);
- }
-
+
if ($c->stash->{class}) {
+ if (ref($module) eq 'ARRAY') {
+ my $tmpmodule = shift(@{$module});
+ $method = shift(@{$module});
+ $module = $tmpmodule;
+ }
+ elsif ($module =~ /->/) {
+ ($module, $method) = split (/->/, $module);
+ }
+ elsif ($module =~ /::/) {
+ my (@module_name) = split (/::/, $module);
+ }
+
if (defined $self->config->{NAMESPACE}) {
$module = $self->config->{NAMESPACE}.'::'.$module;
}
@@ -89,6 +87,20 @@
}
elsif ($c->stash->{'_parent'}) {
+ if (ref($module) eq 'ARRAY') {
+ my $tmpmodule = shift(@{$module});
+ $method = shift(@{$module});
+ $module = $tmpmodule;
+ }
+ elsif ($module =~ /->/) {
+ ($module, $method) = split (/->/, $module);
+ }
+ elsif ($module =~ /::/) {
+ my (@module_name) = split (/::/, $module);
+ $method = pop @module_name;
+ $module = join ('::', @module_name);
+ }
+
if ($code = $c->stash->{'_parent'}->can($module)) {
eval { $code->($c->stash->{'_parent'}, @_); };
$c->log->debug($@) if $@;
More information about the Catalyst-commits
mailing list