Mercurial > pub > Impl
diff Lib/IMPL/Web/View/TTDocument.pm @ 267:bbc0da7ef90e
*IMPL::Web::View refactoring
author | cin |
---|---|
date | Thu, 17 Jan 2013 02:39:44 +0400 |
parents | 0f59b2de72af |
children | 546957c50a36 |
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTDocument.pm Mon Jan 14 03:10:06 2013 +0400 +++ b/Lib/IMPL/Web/View/TTDocument.pm Thu Jan 17 02:39:44 2013 +0400 @@ -75,16 +75,14 @@ } sub RequireControl { - my ($this, $control, $nodeProps) = @_; - - $nodeProps ||= {}; - $nodeProps->{document} = $this; + my ($this, $control) = @_; if (my $factory = $this->controls->{$control}) { return $factory; } else { my $path = $control; + if ( my $template = $this->loader->template($path) ) { my $opts = { %{$this->opts} }; @@ -97,7 +95,8 @@ $template->class || TTControl, $template, $ctx, - $opts + $opts, + join( '/', splice( @{[split(/\//,$path)]}, 0, -1 ) ) ); if ($template->class) {