Extension:Foxway/Usage

The Foxway extension allows you to use some of the features and syntax of the programming language PHP on the wiki pages.

Your PHP code should be placed between the tags  or passed as a parameter to the parser function. Also, for more convenience, you can use the following syntax to call functions implemented in foxway:

There are some differences and limitations when using the methods described above. You can use either one, or both, there is no limit to it.

Useage
The following three examples do the same thing, writing a string :

echo ucfirst( 'hello world' . "!!!\n" );

see example

Differences and limitations
The main difference is that when you use the tag : all outputs is sent to the processing MediaWiki parser and returns as "Strip marker" which are replaced by the results of processing at a later time. Therefore, these results are atomic and can not interact fully with the other elements of wiki-page.

see examples

Examples usage as the tag extension
Wrong use:

Foxway returns the "Strip marker" which here may not be processed correctly

Possible use: echo ''; ''Foxway returns which will be processed with MediaWiki and returns a value of 5

And it allows use  option (for now, this is the only way to debug, implemented just for illustration) echo '';

Examples usage as the parser function
Possible use:

Possible use: