Download the PHP package kros/plates-sections-insertion without Composer
On this page you can find all versions of the php package kros/plates-sections-insertion. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kros/plates-sections-insertion
More information about kros/plates-sections-insertion
Files in kros/plates-sections-insertion
Package plates-sections-insertion
Short Description Plates extension. Insert content into sections.
License GPL-3.0-or-later
Homepage https://github.com/kros/PlatesSectionsInsertion
Informations about the package plates-sections-insertion
Plates Extension: Easily insert sections into Plates templates.
This package is an extension for the template engine Plates.
Define sections content in diferent templates and just insert them into any template. Now it's easy to do it from the controller.
Usage
Define different sections in your template:
template.php file
in templates folder
As allways, you can define another template and use the first one as a layout, so it will be inserted in the content
section:
othertemplate.php file
in templates folder
Define sections contents in different template files so you can use them later in any template:
welcome.php file
in templates folder
bybye.php file
in templates folder
Now we put it together. From inside the controller (index.php
file in this case) we can set the content of a section. Remember you can not render before having set the sections content, so the way to do it is:
make
the templatesetSectionContent
of all the sections you wantrender
finally render the template
index.php file
You can even push or unshift the content of a section from inside the controller using the pushSectionContent
and unshiftSectionContent
methods:
Installation
Requirements
Stand alone extension.
See composer.json
file.
License
GNU General Public License v3.0 (see the LICENSE file for details).