dev-master
9999999-devTextBlocks plugin for CakePHP
The Requires
- php >=5.4.16
- cakephp/cakephp ~3.0
The Development Requires
TextBlocks plugin for CakePHP
Note: This is a non-stable plugin for CakePHP 3.x at this time. It is currently under development and should be considered experimental., (*1)
You can install this plugin into your CakePHP application using composer., (*2)
The recommended way to install composer packages is:, (*3)
composer require cakemanager/cakephp-textblocks
Now load the plugin with the command:, (*4)
$ bin/cake plugin load -r -b TextBlocks
Run the database migrations with:, (*5)
$ bin/cake migrations migrate --plugin TextBlocks
Register new blocks with:, (*6)
Blox::register('my_block');
You can get 2 types of contents: Title and Body. Get your title this way..., (*7)
Blox::title('my_block');
And get your body this way:, (*8)
Blox::body('my_block');
Variables can be passed on both of the getters:, (*9)
// Imagine that the body of 'my_block' is: "Good morning, :name" Blox::body('my_block', [ 'name' => 'Leonardo' ]); // Output will be: "Good morning, Leonardo"
The Blocks can be managed by the CakeAdmin plugin, or you can create CRUD yourself., (*10)
TextBlocks plugin for CakePHP