diff Lib/IMPL/Web/View/TTControl.pm @ 296:86ff93b34f2a

sync
author cin
date Tue, 05 Mar 2013 01:46:32 +0400
parents bbc0da7ef90e
children bd79145657e5
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTControl.pm	Fri Mar 01 03:15:30 2013 +0400
+++ b/Lib/IMPL/Web/View/TTControl.pm	Tue Mar 05 01:46:32 2013 +0400
@@ -6,6 +6,7 @@
 use Scalar::Util qw(blessed);
 use IMPL::declare {
 	require => {
+	    TemplateDocument => 'Template::Document',
         TTContext => 'Template::Context',
         Exception => 'IMPL::Exception',
         ArgumentException => '-IMPL::InvalidArgumentException',
@@ -113,11 +114,20 @@
 }
 
 sub RenderBlock {
-    my ($this,$block, $args) = @_;
+    my ($this, $block, $args) = @_;
     
     $args = {} unless ref $args eq 'HASH';
     
-    return $this->context->include( $block, { %$args, this => $this, template => $this->template } );
+    return $block ? $this->context->include( $block, { %$args, this => $this, template => $this->template } ) : undef;
+}
+
+sub ExportBlock {
+    my ($this,$block) = @_;
+    
+    return TemplateDocument->new({
+        BLOCK => $this->template->blocks->{$block},
+        DEFBLOCKS => $this->template->blocks
+    });
 }
 
 sub AUTOLOAD {