Age | Commit message (Collapse) | Author | Files | Lines |
|
Problem: When creating a new "FunctionParser" object, it should not know
the previously registered content functions which were saved in a static
class property and registered via static class method.
If one creates a new "FunctionParser" object, one would expect that the
array of registered content functions in that object is empty.
Changes:
- Make static property "functions" non-static
- Make static method "register" non-static
- Add new method "registerFromArray"
|
|
The regular expression part `\\` must be written as `\\\\`, not `\\\` in
a PHP string variable. Although both variants (`\\\\` and `\\\`) will be
passed as `\` to the regex engine in this specific case, it's correct to
use 4 backslashes, as the PHP manual tells you:
https://www.php.net/manual/en/regexp.reference.escape.php
|
|
* Rewrite regular expressions and make them easier to read.
* Use named capture groups for backreferences and array keys.
* Allow backslash-escaping of quotes inside string arguments.
* Allow string arguments to be enclosed between single quotes.
|
|
This commit implements a new feature called *content functions* that is
similar but much more powerful than the already existing *content tags*
which you may have already used (`{POST[1]}`, for example).
You now can also add your own *content functions* to do some interesting
things like embedding a YouTube video or other things to prevent typing
repetitive lines of text or code in your entities content.
Read the corresponding wiki page to learn more about this:
https://github.com/Nerdmind/Blog/wiki/Content-functions
|