diff Lib/IMPL/Web/View/TTControl.pm @ 302:673581380e79

Added templates provider functionality to controls minor fixes
author cin
date Mon, 01 Apr 2013 00:41:48 +0400
parents aeeb57a12046
children 2da2564f115d
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTControl.pm	Mon Mar 25 02:04:18 2013 +0400
+++ b/Lib/IMPL/Web/View/TTControl.pm	Mon Apr 01 00:41:48 2013 +0400
@@ -89,6 +89,24 @@
     );
 }
 
+sub GetTemplate {
+    my ($this,$name) = @_;
+    
+    return eval { $this->context->template($name) }; 
+}
+
+sub Include {
+    my ($this,$template, $args) = @_;
+    
+    my $tpl = $this->GetTemplate($template)
+        or die OperationException->new("The specified template isn't found", $template);
+        
+    return $this->context->include(
+        $tpl,
+        $args
+    );
+}
+
 sub AUTOLOAD {
     our $AUTOLOAD;