Not logged in. · Lost password · Register
Forum: General Help and Support Features and Functionality RSS
Is it possible to use php for rendering extension macro?
Avatar
ehQ2W35 #1
Member for a month · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Is it possible to use php for rendering extension macro?
Hello. Is it possible to use php code to render plugin macro, which will be rendered by plugin?
When i use php, the extension syntax isnt rendered by extension, but displayed as a plain text.

For example:
<php>
$GLOBALS['a'] = 'foo:bar';
</php>
{{page><php>echo $GLOBALS['a']</php>&inline&nouser&nodate}}

or

<php>
echo "{{page>foo:bar&inline&nouser&nodate}}";
</php>

Both of these ways aren't working. Is it possible to do it somehow?
Avatar
Michaelsy #2
Member since Jun 2015 · 569 posts · Location: Düsseldorf, Germany
Group memberships: Members
Show profile · Link to this post
You can insert PHP code into a wiki page via <php>...</php>. However, you can not mix PHP code with wiki code directly. That means, PHP code and wiki code must not be embedded in each other.

HTH - Michael Sy.

Edit: This only applies to the standard DokuWiki. At the time, I did not know the PHPwikify plugin yet, which at least strongly relativizes my statement.
By Patreon.com a few eurons can be fed into the code phasers of
the DokuWiki engine. Besides, Andi's posts are worth reading.
This post was edited 2 times, last on 2018-11-11, 11:34 by Michaelsy.
Avatar
schplurtz (Moderator) #3
Member since Nov 2009 · 312 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
In reply to post #1
Hi,

Yes it's possible. The phpwikify plugin renders DokuWiki  markup echoed by php code.

I can't quite remember right now, but I think that sometimes, you have to add the ~~NOCACHE~~ on the page. (but I'm not sure).
http://schplurtz.free.fr/wiki/
Avatar
ehQ2W35 #4
Member for a month · 2 posts
Group memberships: Members
Show profile · Link to this post
Quote by schplurtz:
Hi,

Yes it's possible. The phpwikify plugin renders DokuWiki  markup echoed by php code.

I can't quite remember right now, but I think that sometimes, you have to add the ~~NOCACHE~~ on the page. (but I'm not sure).


Thank you. I will check it out.

Upd: Thats exactly what i was looking for. Thank you very much.
This post was edited on 2018-11-11, 14:01 by ehQ2W35.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2018-12-14, 22:50:48 (UTC +01:00)