[pmwiki-users] Templates and PHP 7.x
Michael Eager
eager at eagercon.com
Thu Nov 7 08:54:00 PST 2019
On 11/6/19 10:09 PM, Petko Yotov wrote:
> I've updated the script, you can get it from:
>
> https://www.pmwiki.org/wiki/Cookbook/Templates
>
> To reply to your question, to return true, is_callable() expects exactly
> a function name without the "('$1')" parts.
>
> So the 4th argument of Markup() should now be "ParametersParse" rather
> than "ParametersParse('\$1')".
>
> Because of this, the functions ParametersParse() and Template() need to
> be updated because now they receive the full match array instead of its
> 1st element. So I rewrote from:
>
> function ParametersParse($text) {...}
>
> into:
>
> function ParametersParse($m) {$text = $m[1]; ...}
>
> Similarly for Template().
>
> Lastly, at the end of the 3rd argument to both Markup() calls, the "e"
> letter needs to be removed, previously:
>
> "/\(:template(.*?):\)/e",
>
> now: "/\(:template(.*?):\)/",
>
>
> Petko
Outstanding. Thanks!
--
Michael Eager eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306
More information about the pmwiki-users
mailing list