Location: PHPKode > scripts > Extensible Template > plugins/bltag_recordset.php
<?
class block_tag_recordset extends ExtTpl_Block_Api {

    public function Process($parametersArray,$templateBlock,$templateVariables) {

	if (isset($parametersArray["TYPE"])) 	
	    $type=$parametersArray["TYPE"];
	else
	    return $templateBlock;

	if (isset($parametersArray["INTERNALNAME"])) 	
	    $intName=$parametersArray["INTERNALNAME"];
	else
	    return $templateBlock;

	if (isset($parametersArray["SELECTQUERY"])) 	
	    $sql=$parametersArray["SELECTQUERY"];
	else
	    return $templateBlock;


	$query_func=$type."_query";
	$fetch_func=$type."_fecth_array";
	
	$rs=$query_func($sql);
	
		
    	$_tplVars=array();
	while ($tplVars=$fetch_func($rs)) {
	    foreach($tplVars as $idx => $rec) {
		$_rec=array();
		if (is_array($rec)) {
    		    foreach($rec as $f => $v) $_rec[$loopIdentifier.$f]=$v;
    		    $_tplVars[]=$_rec;
    	        }
	    }
	}
	    
	$tplVars=$_tplVars;
	$source=array();
	foreach($tplVars as $idx => $record) {
	    $src=$tplBlock;
	    foreach($record as $key => $val) 
		if (!is_array($val)) $src=str_replace("{".$intName."}",$val,$src);
				
	    $src=$this->prProcessTemplate($src,array($intName=>$val));

	    $source[]=$src;
	}
	$auxPlaceHolder=implode("\n",$source);
    	return $auxPlaceHolder;
    }

}
Return current item: Extensible Template