private function parsePair( $variable, $data, $string )
    {
        $match = $this->matchPair($string, $variable);
        if( $match == false ) return $string;

        $str = '';
        foreach ( $data as $k_row => $row ) {
            $temp = $match['1'];
            foreach( $row as $key => $val ) {
                if( !is_array( $val ) ) {
                    $index = array_search( $k_row, array_keys( $data ) );
                    $temp = $this->parseSingle( $key, $val, $temp, $index );
                } else {
                    $temp = $this->parsePair( $key, $val, $temp );
                }
            }
            $str .= $temp;
        }

        return str_replace( $match['0'], $str, $string );
    }
private function parsePair( $variable, $data, $string )
    {
        $match = $this->matchPair($string, $variable);
        if( $match == false ) return $string;

        $str = '';
        foreach ( $data as $k_row => $row ) {
            $temp = $match['1'];
            foreach( $row as $key => $val ) {
                if( !is_array( $val ) ) {
                    $index = array_search( $k_row, array_keys( $data ) );
                    $temp = $this->parseSingle( $key, $val, $temp, $index );
                } else {
                    $temp = $this->parsePair( $key, $val, $temp );
                }
            }
            $str .= $temp;
        }

        return str_replace( $match['0'], $str, $string );
    }
private function parsePair ( $ variable , $ data , $ string ) { $ match = $ this -> matchPair ( $ string , $ variable ) ; if ( $ match == false ) return $ string ; $ str = '' ; foreach ( $ data as $ k_row => $ row ) { $ temp = $ match [ '1' ] ; foreach ( $ row as $ key => $ val ) { if ( ! is_array ( $ val ) ) { $ index = array_search ( $ k_row , array_keys ( $ data ) ) ; $ temp = $ this -> parseSingle ( $ key , $ val , $ temp , $ index ) ; } else { $ temp = $ this -> parsePair ( $ key , $ val , $ temp ) ; } } $ str .= $ temp ; } return str_replace ( $ match [ '0' ] , $ str , $ string ) ; }
Parsing content for loop varliable
@access private
@param string $variable loop name
@param string $value loop data
@param string $string content to replace
@return string replaced content
Parsing content for loop varliable