Joel Lee wrote:
> Hello, I propose to support more data types in Format::apply()
> arguments, Format::apply() only allow string for now. I think it would
> be great to also allow passing an array as the argument, just like
> what Post::get() did.
>
> I've opened a ticket and made a patch for it. I'd like to hear your
> thoughts! :)
>
I think maybe we should ditch the Format class and try something else.
It's arcane -- hard to use, not obvious what it does. And it seems like
everyone wants to throw more parameter types at it than it was
originally written to handle.
The code in the ticket uses $GLOBALS, which we don't use anywhere in
Habari. I think it's a good idea to avoid this.
Maybe this feature could be part of the String class:
String::add_format('out', 'fn_autop');
String::add_format('out', 'fn_fancypants');
function filter_format_fn_autop($value) { return autop($value); }
function filter_format_fn_fancypants($value, $quotestyle) {
return fancy_quoted_thing($value, $quotestyle);
}
echo $foo->out(array('fn_fancypants'=>FP_UBER_FANCY));
Or something?
I dunno. I'm wondering if anyone's happy with the current arrangement.
We should also consider how to handle pre-caching on post content;
content input filtering. We have a field for storing it. I can't think
of a good reason for applying all of these filters at runtime.
Owen
--~--~---------~--~----~------------~-------~--~----~
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/habari-dev
-~----------~----~----~----~------~----~------~--~---