Hi David and everyone else
> mgd_register_filter($name, [$function])
> 
> - if $name and $function are not empty, it will register the function $function with 
>the filter name $name
> - if $function is present but empty (""), it will unregister the function associated 
>with the filter name $name
> - if only the $name parameter is present, it will return the name of the registered 
>function with that filter name.

Hmm. And the uses for such a function is being able to return an object without
making one? 

It seems like a nifty function, I would just like to get an idea on where to use
it :)

Tarjei

 
> Example of use:
> <?
> function my_news_filter($obj) {
>   echo "<h1>$obj->title</h1>\n";
>   echo "<p>$obj->abstract</p>\n";
>   echo "<p>$obj->content</p>\n";
> }
> 
> mgd_register_function("article", "my_news_filter"); // registers the filter func
> 
> $article = mgd_get_article($argv[0]);
> 
> ?>&(article:xnews);<? // the x prefix is necessary to identify the filter name
> 
> echo mgd_register_filter("article"); // prints "my_news_filter"
> 
> mgd_register_filter("article", ""); // unregisters the filter func
> 
> echo mgd_register_filter("article"); // prints nothing
> ?>
> 
> Of course, this is a simple one, and instead of passing the article object, you can 
>pass any PHP variable, provided the filter function is able to understand its 
>parameter.
> 
> Hope that helps,
> 
> David
> 
> > Tarjei
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to