protected function _parseTemplate()
	{
		$matches = array();

		if (preg_match_all('#<jdoc:include\ type="([^"]+)" (.*)\/>#iU', $this->_template, $matches))
		{
			$template_tags_first = array();
			$template_tags_last  = array();

			// Step through the jdocs in reverse order.
			for ($i = count($matches[0]) - 1; $i >= 0; $i--)
			{
				$type = $matches[1][$i];
				$attribs = empty($matches[2][$i]) ? array() : $this->parseAttributes($matches[2][$i]);
				$name = isset($attribs['name']) ? $attribs['name'] : null;

				// Separate buffers to be executed first and last
				if ($type == 'module' || $type == 'modules')
				{
					$template_tags_first[$matches[0][$i]] = array('type' => $type, 'name' => $name, 'attribs' => $attribs);
				}
				else
				{
					$template_tags_last[$matches[0][$i]]  = array('type' => $type, 'name' => $name, 'attribs' => $attribs);
				}
			}
			// Reverse the last array so the jdocs are in forward order.
			$template_tags_last = array_reverse($template_tags_last);

			$this->_template_tags = $template_tags_first + $template_tags_last;
		}

		return $this;
	}
protected function _parseTemplate()
	{
		$matches = array();

		if (preg_match_all('#<jdoc:include\ type="([^"]+)" (.*)\/>#iU', $this->_template, $matches))
		{
			$template_tags_first = array();
			$template_tags_last  = array();

			// Step through the jdocs in reverse order.
			for ($i = count($matches[0]) - 1; $i >= 0; $i--)
			{
				$type = $matches[1][$i];
				$attribs = empty($matches[2][$i]) ? array() : $this->parseAttributes($matches[2][$i]);
				$name = isset($attribs['name']) ? $attribs['name'] : null;

				// Separate buffers to be executed first and last
				if ($type == 'module' || $type == 'modules')
				{
					$template_tags_first[$matches[0][$i]] = array('type' => $type, 'name' => $name, 'attribs' => $attribs);
				}
				else
				{
					$template_tags_last[$matches[0][$i]]  = array('type' => $type, 'name' => $name, 'attribs' => $attribs);
				}
			}
			// Reverse the last array so the jdocs are in forward order.
			$template_tags_last = array_reverse($template_tags_last);

			$this->_template_tags = $template_tags_first + $template_tags_last;
		}

		return $this;
	}
protected function _parseTemplate ( ) { $ matches = array ( ) ; if ( preg_match_all ( '#<jdoc:include\ type="([^"]+)" (.*)\/>#iU' , $ this -> _template , $ matches ) ) { $ template_tags_first = array ( ) ; $ template_tags_last = array ( ) ; // Step through the jdocs in reverse order. for ( $ i = count ( $ matches [ 0 ] ) - 1 ; $ i >= 0 ; $ i -- ) { $ type = $ matches [ 1 ] [ $ i ] ; $ attribs = empty ( $ matches [ 2 ] [ $ i ] ) ? array ( ) : $ this -> parseAttributes ( $ matches [ 2 ] [ $ i ] ) ; $ name = isset ( $ attribs [ 'name' ] ) ? $ attribs [ 'name' ] : null ; // Separate buffers to be executed first and last if ( $ type == 'module' || $ type == 'modules' ) { $ template_tags_first [ $ matches [ 0 ] [ $ i ] ] = array ( 'type' => $ type , 'name' => $ name , 'attribs' => $ attribs ) ; } else { $ template_tags_last [ $ matches [ 0 ] [ $ i ] ] = array ( 'type' => $ type , 'name' => $ name , 'attribs' => $ attribs ) ; } } // Reverse the last array so the jdocs are in forward order. $ template_tags_last = array_reverse ( $ template_tags_last ) ; $ this -> _template_tags = $ template_tags_first + $ template_tags_last ; } return $ this ; }
Parse a document template

@return  object  instance of $this to allow chaining
Parse a document template