Download the PHP package popov/zfc-block without Composer
On this page you can find all versions of the php package popov/zfc-block. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download popov/zfc-block
More information about popov/zfc-block
Files in popov/zfc-block
Package zfc-block
Short Description Create separatly custom template bock with html, css, js etc.
License MIT
Homepage http://agere.com.ua
Informations about the package zfc-block
ZF Block Helper
Create separately custom template bock with html, css, js etc.
Usage
For Expressive: register ZfcBlock
module in config/config.php
with Popov\ZfcBlock\ConfigProvider::class
.
For MVC: register with Popov\ZfcBlock
in your configuration.
Create new Block
class in your module with name LoginBlock
This class must extend Popov\ZfcBlock\Block\Core
for allow usage basic functionality such as translate, check permission
and other auxiliary opportunities.
Next step you can:
- create
Factory
for this block; - use
ReflectionFactory
, this will be convenient if project is under development. Register factory in yourconfig/autoload/dependencies.global.php
If you decide use ReflectionFactory
then minimum bare you need add alias for your block to configuration
Be aware. Don't use
ReflactionFactory
on production, create realFactory
for your block class.
After that your can call your block in any template with
Or the same example with advanced usage
Advanced usage can be useful for set additional parameters.
For example, block template can have next view
Configuration
block_plugin_config
in config file is used for set some specific configuration for Block
.
All config parameters will be set with setter
.
default
key sets general configuration forBlock
- also configuration can be set per
resource/action
, where resource in most cases iscontroller
ormodule
taken from URL.
If you need some complex parameters in your Block
use Factory
for this purpose.
Types
- list (roster)
In action:
All your blocks will be rendered automatically one by one.