Releases: thephpleague/plates
Releases · thephpleague/plates
3.0.0
- Added ability to share data across templates.
- Added ability to preassign data to specific templates.
- Added ability to create one-off template functions, without using an extension.
- Added new folder "fall backs", where missing folder templates will fall back to the default folder.
- Added new
render()
method toEngine
class, improving the use of theEngine
as the primary API. - Templates variables are now accessed without the
$this
pseudo-variable. - Total overhaul to how extensions are registered. Replaced
getFunctions()
method with newregister()
method. - Section content is no longer assigned to template variables. Use the the
section()
function instead. - Renamed section
end()
function tostop()
. This fits more appropriately with thestart()
function. - Renamed
get()
function tofetch()
. - Renamed
pathExists()
method in theEngine
class toexists()
. - Renamed
getTemplatePath()
method in theEngine
class topath()
. - Renamed
makeTemplate()
method in theEngine
class tomake()
. - Removed the ability to assign template data directly to the
Template
class. For example:$this->name = 'Jonathan'
. This applies both within and outside of templates. Use thedata()
method instead. - Removed
getEngine()
method from theTemplate
class. There's no reason to need this anymore. - Removed
addFolders()
method from theEngine()
class. - Removed
unloadExtension()
andunloadExtensionFunction()
methods from theEngine()
class.
2.1.0
- Improved DocBlocks throughout the library.
- The
insert()
functionality has been moved to a new extension, called Nest. - A new
get()
function was also added with this extension, which offers an alternative syntax for nesting templates. - Improved error messages.
- A new error check which prevents the calling of the
render()
function from within templates themselves. If this functionally is required, use the nesting functions instead. - Added a clearer error message to the
content()
function when calling it from a non layout template. - Added a clearer error message to the
batch()
extension function when a provided function does not exist. - Fixed a bug in the engine where it was possible to overwrite a default extension when loading extensions.
2.0.0
- Added stacked layouts, allowing even further simplification and organization of templates.
- Added new
unloadExtension()
andunloadExtensionFunction()
methods to theEngine()
class. - Added
getEngine()
method to theTemplate
class. - Added
addFolders()
andloadExtensions()
methods to theEngine()
class. - Nested templates are now self-contained objects, with their own variables and layouts.