First of all you can define as much templates in one file, as you want. This file only has to be valid XML.
HTML Code:
<html>
<head>...</head>
<body>
<tal:block condition="submitted">...show results...</tal:block>
<tal:block condition="not:submitted">...show form</tal:block>
</body>
</html>
is ok, but you even could write
HTML Code:
<tal:block>
<html tal:condition="submitted">
<head>...</head>
<body>
...show results...
</body>
</html>
<html tal:condition="not:submitted">
<head>...</head>
<body>
...show form...
</body>
</html>
</tal:block>
I'd prefer to define macros and use them, when they are required:
HTML Code:
<html>
<head>...</head>
<body>
<tal:block metal:define-macro="submit">...show results...</tal:block>
<tal:block metal:define-macro="form">...show form...</tal:block>
<tal:block metal:use-macro="${action}" />
</body>
</html>
In PHP you would write:
PHP Code:
$tal = new PHPTAL(<template.file>);
$tal->action = (isset($_REQUEST['submit']))?'submit':'form';
// define some other TAL variables to display...
echo $tal->execute();
If you use macros, you can put them to an external file and reuse them in other templates.
Another way would be to use slots.
About the 3d-array-problem:
Until now I did not find a way to do this in PHPTAL, there is no way to exit a loop when a condition (cols == x) becomes true or whatever.
How would you do this in patTemplate (which I don't know until now)?