Index: Template/src/parsers/tst_to_ast/implementations/tst_to_ast_transformer.php
===================================================================
--- Template/src/parsers/tst_to_ast/implementations/tst_to_ast_transformer.php	(revision 5799)
+++ Template/src/parsers/tst_to_ast/implementations/tst_to_ast_transformer.php	(working copy)
@@ -679,10 +679,20 @@
             $customBlockOutput = $this->outputVariable->getAst();
             $this->outputVariable->pop();
 
-            $result[] = new ezcTemplateGenericStatementAstNode( 
-                new ezcTemplateConcatAssignmentOperatorAstNode( $this->outputVariable->getAst(), 
-                   new ezcTemplateFunctionCallAstNode( $class . $def->method, 
-                   array( $params, $customBlockOutput ) ) ) ); 
+            if ( isset($def->sendTemplateObject) && $def->sendTemplateObject )
+            {
+                $result[] = new ezcTemplateGenericStatementAstNode(
+                    new ezcTemplateConcatAssignmentOperatorAstNode( $this->outputVariable->getAst(),
+                       new ezcTemplateFunctionCallAstNode( $class . $def->method,
+                       array( new ezcTemplateVariableAstNode("this->template"), $params, $customBlockOutput ) ) ) );
+            }
+            else
+            {
+                $result[] = new ezcTemplateGenericStatementAstNode(
+                    new ezcTemplateConcatAssignmentOperatorAstNode( $this->outputVariable->getAst(),
+                       new ezcTemplateFunctionCallAstNode( $class . $def->method,
+                       array( $params, $customBlockOutput ) ) ) );
+            }
 
             return $result;
         }
@@ -718,11 +728,21 @@
                 // And assign it to the output.
                 return $this->assignToOutput( new ezcTemplateLiteralAstNode($r) );
             }
-         
-            return new ezcTemplateGenericStatementAstNode( 
-                new ezcTemplateConcatAssignmentOperatorAstNode( $this->outputVariable->getAst(), 
-                   new ezcTemplateFunctionCallAstNode( $class .$def->method, 
-                   array( $params ) ) ) ); 
+
+            if ( isset($def->sendTemplateObject) && $def->sendTemplateObject )
+            {
+                return new ezcTemplateGenericStatementAstNode(
+                    new ezcTemplateConcatAssignmentOperatorAstNode( $this->outputVariable->getAst(),
+                       new ezcTemplateFunctionCallAstNode( $class .$def->method,
+                       array( new ezcTemplateVariableAstNode("this->template"), $params ) ) ) );
+            }
+            else
+            {
+                return new ezcTemplateGenericStatementAstNode(
+                    new ezcTemplateConcatAssignmentOperatorAstNode( $this->outputVariable->getAst(),
+                       new ezcTemplateFunctionCallAstNode( $class .$def->method,
+                       array( $params ) ) ) );
+            }
         }
     }
 
Index: Template/src/structs/custom_block_definition.php
===================================================================
--- Template/src/structs/custom_block_definition.php	(revision 5799)
+++ Template/src/structs/custom_block_definition.php	(working copy)
@@ -113,5 +113,11 @@
 
 
     public $isStatic = false;
+
+    /**
+     *
+     */
+    public $sendTemplateObject = false;
+
 }
 ?>
