Hi there, 

i have written my own keyword handler for phptal which handles the link:
keyword. This worked quite well for simple links but now i want to build 
more complex ones.

I call my handler like this in the simple case:
<a tal:attributes="href link:/*/*/folder">...</a>
The code in the template is this:
That comes up with a link href="/Module/Controller/folder" which is ok.

Now i want to do this:
<a tal:attributes="href link:/*/*/folder:goto//${ud/id}">
The code in the template should look like that:
with XXX shall be a function of phptal translating ${ud/id} to the actual 

The important part of my code is this: ($t[1] is the part after the ":")
        $p = explode('//', $t[1]);
        $parameter = 'array(';
        while(($k = array_shift($p)) && ($value = array_shift($p))) {
            $parameter .= ("'".$k."'=>".phptal_tales($value,$nothrow).',');
        $parameter .= ')';
But phptal_tales() seems not to be the right function as it generates the line 
as this:
 , 'id').',))
which ends in a parser error...

Whats the correct way to implement this?

 MfG, Christian Welzel

  GPG-Key:     http://www.camlann.de/key.asc
  Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15

PHPTAL mailing list

Reply via email to