Filters exist to process text that isn't Haml, and may obey other rules 
of indentation, etc. It's possible to implement a superset of the 
functionality of filters using helpers and the :plain filter (although 
obviously this requires at least the one filter to work), but that's 
just ugly.

In short, helpers should be used when doing something with Haml, and 
filters otherwise. Except filters can't dynamically access anything (nor 
can they take args, to answer your other question). Yet.

- Nathan

s.ross wrote:
> That seems like it would work, and there's every reason to use it but 
> it begs the question: Why not do pretty much every filtering thingie 
> this way instead of filters? Conversely, there is the issue of the 
> implied "do". The code reads like Ruby, but because it's Haml, you 
> leave off the "do" so it looks invalid (ecch).
>
> Thoughts?
>
>
> On Dec 19, 2007, at 11:26 AM, Evgeny wrote:
>
>> How about a helpers that accept blocks?
>> Can't they kind of replace filters somehow?
>>
>> Like for example this disfunctional code:
>> http://pastie.caboo.se/130606
>>
>>
>> - evgeny
>>
>>
>> On Dec 19, 2007 9:10 PM, s.ross <[EMAIL PROTECTED] 
>> <mailto:[EMAIL PROTECTED]>> wrote:
>>
>>     How about the optional argument specifying the number of cols?
>>
>>     Thx
>>
>>     On Dec 19, 2007, at 11:04 AM, Nathan Weizenbaum wrote:
>>
>>>     Filters are, at the moment, all evaluated at precompile-time,
>>>     rather 
>>>     than render-time. This means that there's no way to get a
>>>     reference to 
>>>     the view object that has helpers defined, nor to take arguments
>>>     from the 
>>>     template. We plan to add this ability at some point.
>>
>>
>>
>>
>>
>>
>>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to