Mercurial > pub > Impl
diff Lib/IMPL/Web/View/TTFactory.pm @ 305:b5d5793f348e
TTView refactoring, still experiencing memory leaks
author | sergey |
---|---|
date | Wed, 17 Apr 2013 18:00:19 +0400 |
parents | aeeb57a12046 |
children | 5e4e7c8fbca1 |
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTFactory.pm Mon Apr 15 07:44:50 2013 +0400 +++ b/Lib/IMPL/Web/View/TTFactory.pm Wed Apr 17 18:00:19 2013 +0400 @@ -27,14 +27,14 @@ instances => PROP_RW, baseLocation => PROP_RW, base => PROP_RW, - require => PROP_RO, + registry => PROP_RO, blocks => PROP_RO, initialized => PROP_RO ] }; sub CTOR { - my ($this,$template,$context,$baseLocation,$require) = @_; + my ($this,$template,$context,$path,$registry) = @_; die ArgException->new("A template is required") unless $template; @@ -42,17 +42,18 @@ if $this->factory and not ref $this->factory; $context ||= new Template::Context(); + my $baseLocation = join( '/', splice( @{[split(/\//,$path)]}, 0, -1 ) ); $this->template($template); $this->context($context); $this->baseLocation($baseLocation); $this->instances(0); - $this->require($require); + $this->registry($registry); if (my $baseTplName = $template->extends) { $baseTplName =~ s{^\./}{$baseLocation/}; - my $base = &$require($baseTplName) + my $base = $registry->Require($baseTplName) or die OpException->new("The specified base template isn't found"); $this->base($base); @@ -99,7 +100,7 @@ my ($module) = @_; $module =~ s/^\.\//$baseLocation\//; - return $require->($module); + return $registry->Require($module); }}); }