While I was looking at the pager example, I couldn't help but think
this could be fixed by having a few helper classes for this; helper
classes that would make your phptal code cleaner and abstract out
certain typical tasks of a pager.

The same could be said for the dropdown scenario. All in all, I hate
having explicit code in my templates, why can't things in phptal be
fixed in the phptal way? ;-)


Best,
  Tjerk

2009/11/18 Kornel Lesiński <kor...@aardvarkmedia.co.uk>:
> On 17-11-2009 at 18:42:50 Iván Montes <drsl...@pollinimini.net> wrote:
>
>> After looking at the wiki page examples, couldn't we solve this with
>> specialized tales modifiers?
>
> This is taken straight from one of my pages:
>
> <a tal:condition="php:pager.getNumberOfPages() GT 1 AND
> pager.getCurrentPage() LT pager.getNumberOfPages()-1"
> href="${php:pager.getURL(pager.getNumberOfPages())}#p${latest_post/id}">Last
> »</a>
>
> I could replace it with one-off special modifier, or redundant method in
> pager class, but I'm not sure if that's the best thing to do, and definitely
> it's not on path of least resistance.
>
> Why not write it like this:
>
> <a tal:condition="pager/getNumberOfPages GT 1 AND pager/getCurrentPage LT
> pager/getNumberOfPages-1"
> href="${pager/getURL(pager/getNumberOfPages)}#p${latest_post/id}">Last »</a>
>
> ?
>
>
> --
> regards, Kornel
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL@lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>



-- 
--
Tjerk

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to