Skip to content

Commit

Permalink
added a note about the usage of Twig_Template methods
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Sep 27, 2011
1 parent b096e21 commit d9d38d6
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions lib/Twig/Template.php
Expand Up @@ -57,6 +57,9 @@ public function getEnvironment()
/**
* Returns the parent template.
*
* This method is for internal use only and should never be called
* directly.
*
* @return Twig_TemplateInterface|false The parent template or false if there is no parent
*/
public function getParent(array $context)
Expand All @@ -80,6 +83,9 @@ abstract protected function doGetParent(array $context);
/**
* Displays a parent block.
*
* This method is for internal use only and should never be called
* directly.
*
* @param string $name The block name to display from the parent
* @param array $context The context
* @param array $blocks The current set of blocks
Expand All @@ -98,6 +104,9 @@ public function displayParentBlock($name, array $context, array $blocks = array(
/**
* Displays a block.
*
* This method is for internal use only and should never be called
* directly.
*
* @param string $name The block name to display
* @param array $context The context
* @param array $blocks The current set of blocks
Expand All @@ -118,6 +127,9 @@ public function displayBlock($name, array $context, array $blocks = array())
/**
* Renders a parent block.
*
* This method is for internal use only and should never be called
* directly.
*
* @param string $name The block name to render from the parent
* @param array $context The context
* @param array $blocks The current set of blocks
Expand All @@ -135,6 +147,9 @@ public function renderParentBlock($name, array $context, array $blocks = array()
/**
* Renders a block.
*
* This method is for internal use only and should never be called
* directly.
*
* @param string $name The block name to render
* @param array $context The context
* @param array $blocks The current set of blocks
Expand All @@ -152,6 +167,16 @@ public function renderBlock($name, array $context, array $blocks = array())
/**
* Returns whether a block exists or not.
*
* This method is for internal use only and should never be called
* directly.
*
* This method does only return blocks defined in the current template
* or defined in "used" traits.
*
* It does not return blocks from parent templates as the parent
* template name can be dynamic, which is only known based on the
* current context.
*
* @param string $name The block name
*
* @return Boolean true if the block exists, false otherwise
Expand All @@ -164,7 +189,12 @@ public function hasBlock($name)
/**
* Returns all block names.
*
* This method is for internal use only and should never be called
* directly.
*
* @return array An array of block names
*
* @see hasBlock
*/
public function getBlockNames()
{
Expand All @@ -174,7 +204,12 @@ public function getBlockNames()
/**
* Returns all blocks.
*
* This method is for internal use only and should never be called
* directly.
*
* @return array An array of blocks
*
* @see hasBlock
*/
public function getBlocks()
{
Expand Down

0 comments on commit d9d38d6

Please sign in to comment.