I've been trying to get this php code (modeled after the first example) to
work. I'm not for sure if this is the way to tell the phptal templating
engine what to use to replace the attribute values in the template.tmpl
file. Help is much appreciated and would get me "off the ground" with this
templating system.

php code:
<?php
require_once 'PHPTAL.php';
$template = new PHPTAL('templates/template.tmpl');
class links {
    public $href;
    public $text;

    function links($href, $text) {
        $this->href = $href;
        $this->text = $text;
    }
}
$left = new links("www.google.com", "google");
$right = new links("www.example2.com", "example2");
try {
    echo $template->execute();
}
catch (Exception $e) {
    echo $e;
}
?>
template looks like:
<div id="container">
    <div id="header" class="left"><a href="http://www.sample.com";
    tal:attributes="href links/left"
    tal:content="left/text">left</a>
</div>
    <center><img src="images/image006.png" class="header" /></center>
    <div id="header" class="right"><a href="http://www.sample.com";
    tal:attributes="href right/href; title right/title"
    tal:content="right/text">right</a>
</div>
</div>
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to