Pear IT Template nested blocks problem on a nested row

From: Date: Wed, 21 Mar 2007 01:00:52 +0000
Subject: Pear IT Template nested blocks problem on a nested row
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26890@lists.php.net to get a copy of this message
Hello PEAR users, I am trying to make a nested table on a already nested row. The expected result is similar to this.. http://i32.photobucket.com/albums/d41/lmiranda723/tpl_blocks.jpg Where the filename is inside a <td> that loops, that is my expected result. I am trying it on {ASSIGNED_TO_USERNAME} using this code.. $query_files = "select * from proofing_files group by filename_id";
$exec_files = $db->queryAll($query_files); foreach ($exec_files as $name) {
    $query_users = "select * from proofing_accounts_assigned where
filename_id = '".$name['filename_id']."'";
    $exec_users = $db->queryAll($query_users);
    print_r($exec_users);
    $tpl->setCurrentBlock('row');
    $tpl->setVariable('FILENAME_ID', $name['filename_id']);
    $tpl->setVariable('DESCRIPTION', $name['description']);
        foreach ($exec_users as $user) {
        $tpl->setCurrentBlock("cell") ;
        $tpl->setVariable('ASSIGNED_TO_USERNAME',
$name['assigned_to_username']);
        }
    $tpl->parseCurrentBlock('row');
} return $tpl->get();
html template code
<!-- BEGIN row --> <tr bgcolor="{ROW_COLOR}"> <td align="center" valign="top">{FILENAME_ID}</td> <td align="center" valign="top"><table border="1"> <tr>
    <td>file1.jpg</td>
    </tr>
<tr>
    <td>file2.jpg</td>
    </tr>
<tr>
    <td>file3.jpg</td>
    </tr>
</table></td> <td align="center" valign="top"> <table border="1"> <!-- BEGIN col --> <tr>
    <td>{ASSIGNED_TO_USERNAME}</td>
    </tr>
<!-- END col --> </table> </td> <td>{DESCRIPTION} </td> </tr> <!-- END row -->
But, i could not get it to work. Mostly, it displays the {ASSIGNED_TO_USERNAME} after the last data from my {FILENAME_ID}. Would this be possible? How would i make it like this? file_id | files | users 52 | file1.jpg | user1@example.com
    | file2.jpg | user2@example.com
    | file3.jpg |
-- Louie Miranda (lmiranda@gmail.com) http://www.axishift.com //JSM-W

« previous php.pear.general (#26890) next »