Location: PHPKode > scripts > UI Template > ui-template/frea/Template/Dom/Namespace/Loop.php
<?php
/**
 * @package frea-framework
 * @subpackage Template
 * 
 * @copyright 2009 frea-framework
 * @author Dawid Kraczkowski hide@address.com
 * @license  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
 */
class Template_Dom_Namespace_Loop extends Template_Dom_Namespace
{
	protected $loopName;
	protected $countName;
	protected $iteratorName;
	protected $varPath;
	
	public function insertBefore()
	{
		$this->iteratorName = "iterator".md5(time());
		$this->loopName = $this->node->getAttribute("name");
		$this->varPath = $this->node->getAttribute("select");
		$st = <<<LOOP
		 <?php
	Template_VariableContainer::registerLoop("{$this->loopName}","\\{$this->varPath}");
	do{ ?>\n\n
LOOP;
		
		return $st;
		
	
	}
	public function insertAfter()
	{
		return "\n\n\n<?php   } while(Template_VariableContainer::nextItem(\"{$this->loopName}\")); ?>\n\n";
	}
	
}
Return current item: UI Template