Empty Block

Funcdown Manual

Installation

Requirements

Other than PHP it self, funcdown has no special requirements nor installation. The only strong fact is that standard, good HTML and PHP knowledge is required in order for one to operate with funcdown properly. Speaking of PHP Version, >=8.2 is required where one also need to make sure that the following three PHP extensions are enabled: xml, ctype and mbstring.

When and if those conditions are met, assuming that You have obtained funcdown code, and did according to the instructions there, You may throw an look at Basic Usage and start goofing with funcdown.

Configuration

Just like PHP it self, funcdown is using it's own .ini file, with it's default Runtime options, with few differences. It is masked as PHP (eg: .funcdown.conf.ini.php) and has a DOT as prefix for the filename and sits within PHP block comment. This is because it indicates that it is system (hidden) file on unix-alike production `boxes` (in 99.99% cases).

On well configured server, everything within a file that has .php extension, wrapped with php tags is invisible to `bystander/visitor` of any kind... and PHP simply doesn't give a dime about extension when it comes to parsing various x-text formats. All it takes is properly formatted content within. Valid syntax in other words. One plus for a bit of additional security, nothing else.


Basic Usage

Somewhere in Your script, prefferably at the top of it ..

<?php require_once '/path/to/funcdown/extension.php'; $funcdown = new \H\scope\Funcdown(5);

.. and thеn Funcdown::parse() funcdown source by using any of given INPUT methodology.

Funcdown code or input value for Funcdown::parse() method, can come in a form of value of PHP $variable (meaning directly as string as well), as valid filepath or as compliant array. Here are pseudo examples for three possible funcdown input types, how to parse/transform funcdown syntax to html markup.

INPUT

STRING

Native Syntax
You write this ...

<?php $funcdown-> parse ('!{Comment text} D [p {This is my paragraph text}]', false); echo $funcdown-> release();
ARRAY

Hashmap Syntax
You write it like this ...

<?php $funcdown-> parse ([ '!' => 'Comment text', // ! = <!-- ... --> 'D' => [ // Capital D = div 'p' => 'This is my paragraph text' ] ], false); echo $funcdown-> release();
FILEPATH

While using Native Syntax within:
- your_funcdown_file.fncd.phtml
- .. or your_funcdown_file.fncd ..

!{Comment text} D [ p {This is my paragraph text} ]

.. you call it like this ..

<?php echo $funcdown-> parse ('/path/to/my_funcdown_file.fncd')-> release();

OUTPUT

Once when Funcdown::release() method has been called, be it string, array or external file, You will get the sample below.

<!-- Comment text --> <div> <p>This is my paragraph text</p> </div>

It simply doesn't matter whether funcdown is written as single liner or with a lots of space style, generated markup will be formatted in the same way, unless runtime option is modified.


Advanced Usage

Empty Block
Empty Block
Empty Block
Empty Block