Download the PHP package phpffcms/ffcms-templex without Composer
On this page you can find all versions of the php package phpffcms/ffcms-templex. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phpffcms/ffcms-templex
More information about phpffcms/ffcms-templex
Files in phpffcms/ffcms-templex
Package ffcms-templex
Short Description Simple html template engine for ffcms on native php-html syntax
License MIT
Homepage http://pmcore.ru
Informations about the package ffcms-templex
Templex
Templex - native php template system build on top of php plates framework: thephpleague/plates. Templex used in phpffcms as a basic template engine with pack of html helpers that makes posible fast build html-code output.
Installation
Using composer:
Usage
To see complete examples please take a look on directory.
Initialize
Here you can see a simple example of template system initialization:
Use layouts
The major feature of any template system is a layouts. Plates provide a complete feature to use layouts in templating:
Sections extend
Section allow you to make dynamic templates with block override features. To understand how section extending works take a look at simple example:
and :
After initialization and executing the output will be:
The section in after rendering accept the result from ... section. You can make a multiple extend by section using instead of .
Html helpers
Templex provide simple and clear php-based html code generator. The main part of developing process in any application is to build html output of tables, listing, grids and forms.
In this section you will see the main features of html code generator helpers.
Listing
To draw a simple listing you should use and then call to add each one element.
Listing can be used inline or as named factory object. Inline object usage are prefered for pre-defined elements that should be displayed "right here":
Named object can be defined for more complex usage. For example - add elements of listing in cycle:
Complete example with some "magic": ` will compile to output:
Table
Tables often used to display structured data. Templex provide helper to draw table simple & fast. To draw table you should use $this->table([properties])
instance and then implement thead ->head([properties], [items])
features and tbody ->row([items], order)
items and finally call ->display()
to get html output.
As a listings, table can be used in inline or names style (careful! code below is symbolic):
So take a look at complete example:
lead to output:
If you want to use html syntax in text
property you should pass in item array.
Selectize column
Table helper provide feature to display multiple checkboxes at table column index. If you want to add at each element of column checkbox input field, use selectize:
Note, that should be used before or called.
Sortable column
If you want to sort data in tables you can use sorter helper of table building. Sorter add up/down arrow at defined column index with named link.
Forms
Form helper provide features of fast form field building, styling and display.