tanakahisateru / pinoco

Web site development framework using PHP and (mainly) PHPTAL
http://tanakahisateru.github.io/pinoco/
Other
43 stars 10 forks source link

Extend PHPTAL for attribute overriding #23

Closed tanakahisateru closed 13 years ago

tanakahisateru commented 13 years ago

I want to reference an original attribute's value in tales of tal:attributes. And, sometimes "attributes" causes typo by designers. Shortcut name:"attr", isn't cool?

<a href="prev.html"     tal:attributes="href url:/subdir/prev.html">prev</a>
<a href="next.html"     tal:attributes="href url:/subdir/next.html>next</a>
<a href="../index.html" tal:attributes="href url:/index.html">up</a>
<a href="prev.html"     ptal:attr="href url:/subdir/${attr/href}">prev</a>
<a href="next.html"     ptal:attr="href url:/subdir/${attr/href}">next</a>
<a href="../index.html" ptal:attr="href url:/subdir/${attr/href}">up</a>
tanakahisateru commented 13 years ago

DRY! it's important to minimize knowledge.

tanakahisateru commented 13 years ago

reviewed by PHPTAL project developer!

tanakahisateru commented 13 years ago

${attr} should be stack for nested tags.

tanakahisateru commented 13 years ago

fixed (stack was not needed)