Changelog 6.1.1
- New option to enable the infinite loop detection
setDetectInfiniteLoop(bool $p), disabled by default
Changelog 6.1.0
- New options to parameter the engine values extractor using
setSeekValueMode(string $mode),$modeamongcurrent|parents|root - If the current block is not able to provide a value to be rendered then the engine will automatically seek for it using the
seekValueModeparameter - Detect an infinite loop when building a view
- Allowing the render of recursive arrays of PhpEcho blocks
- Cloning a
PhpEchoblock is now forbidden, the engine will throw anBadMethodCallException - Tests are updated
Changelog 6.0.1
- Minor bugfix in
addBlock()
Changelog 6.0.0
- Code refactoring
- As PHP is now a pretty self-describing and self-documenting language, the quantity of PHPDoc is now heavily reduced
- Removed feature: space notation for arrays. Any space in a key is now preserved, the engine doesn't interpret them as sub-arrays anymore
- New feature: management of local and global vars, please note that the local always override the global ones
- New feature: defining global values that will be available through the whole tree of blocks using:
injectVars(array $vars) - New feature: defining local values after instantiating a
PhpEchoblock at once using:setVars(array $p) - Internal heavy change: there's no more copy of variables between blocks (reduce the memory footprint and increase the global performance)
- If the current block is not able to provide a value to be rendered then the engine will automatically seek for it in the root of the tree
- Better management of values composed of nested array
- Cloning a
PhpEchoblock is now possible, the cloned value keeps everything but the link to its parent block. The new one is orphan
Changelog 5.4.1:
- Minor bugfix in method
isArrayOfPhpEchoBlocks(mixed $p)when$pis an empty array
Changelog 5.4.0:
- Add new abstract class
ViewBuilderthat help to manipulate abstract views as objects
Changelog 5.3.1:
- Add option to return natively
nullwhen a key doesn't exist instead of throwing anExceptionBy default this option is not activated. To activate, use:PhpEcho::setNullIfNotExist(true);; to deactivate, use:PhpEcho::setNullIfNotExist(false);
Changelog 5.3.0:
- Code optimization and improvement of the parameters management
- The method
hasGlobalParam(string $name)is nowstatic - You can now define the seek order to get the first value either
from the
localorglobalcontext usinggetAnyParam(string $name, string $seek_order = 'local'): mixed - It's possible to set at once a parameter into the local and global context using
setAnyParam(string $name, mixed $value) - It's possible to unset at once a parameter from the local and the global context using
unsetAnyParam(string $name)
Test files are updated
Changelog 5.2.1:
- Improving the local and global parameters' management
Add new methodgetAnyParam(string $name)that will return first the local value of the parameter if defined or the global value instead or throw finally an exception if the parameter is unknown
Offers the possibility to unset any local or global parameter usingunsetParam(string $name)orunsetGlobalParam(string $name)
You can now check if a parameter is defined either in the local or global array usinghasAnyParam(string $name)
Test files are updated
Changelog 5.2.0:
- Space is not used as directory separator anymore, the only admitted directory separator is now / (slash)
Space is now preserved in the filepath.
Everywhere you wrote for example
new PhpEcho('block dummy_block.php');, you must replace it withnew PhpEcho('block/dummy_block.php');The same thing for$this->renderblock('block dummy_block.php');which must be replaced by$this->renderBlock('block/dummy_block.php');and also forthis->renderByDefault('preloader', 'block preloader.php')which becomethis->renderByDefault('preloader', 'block/preloader.php')If you have previously used a space as directory separator, you'll have to review all the view files. If you stayed stuck with slash (/), no problems, this upgrade won't impact your code.
Changelog 5.1.1:
- Standard helpers are now injected once automatically
Changelog 5.1.0:
- The method
getHelper(string $name): Closureis not static anymore - The equivalent static is now defined as
getHelperBase(string $name): Closure - The method
isHelper(string $name): booldoes not throw anyExceptionanymore and only returns a strict boolean - Internally some code optimization and better logic segmentation: new method
getHelperDetails(string $name): array
Changelog 5.0.0:
- Removing th constant
HELPER_BOUND_TO_CLASS_INSTANCE, it's replaced byPhpEcho::addBindableHelper - Removing the constant
HELPER_RETURN_ESCAPED_DATA. Now, the engine is able to check when data must be escaped and preserve the native datatype when it's safe in HTML context - Instead of dying silently with
nullor empty string, the engine now throws in all case anExceptionYou must produce a better code as it will crash on each low quality segment. - Add new method
renderBlock()to link easily a child block to its parent - Many code improvements
- Fully tested: the core and all helpers have been fully tested
- Add new helper to the standard library
renderIfNotSet()that render a default value instead of throwing anExceptionfor any missing key in the stored key-value pairs
Changelog 5.0.0:
This version is a major update and breaks the compatibility with the code
written for the previous version of the engine. The changes impact mainly the code
generating the helpers. The code for the view part of your project is not impacted by the upgrade.