ciricihq / blocks
Blocks plugin for CakePHP
Installs: 2 657
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 0
Open Issues: 0
Type:cakephp-plugin
Requires
- php: >=5.4.19
- cakephp/cakephp: ~3.2
Requires (Dev)
- ciricihq/cirici-codesniffer: dev-master
- phpunit/phpunit: ~5.3.0
- squizlabs/php_codesniffer: ~2.5.1
This package is auto-updated.
Last update: 2024-10-29 04:17:14 UTC
README
A really simple plugin that allows you to manage and show small content blocks.
Install
Using Composer:
composer require ciricihq/blocks
You then need to load the plugin. You can use the shell command:
bin/cake plugin load Cirici/Blocks
or by manually adding statement shown below to your app's config/bootstrap.php
:
Plugin::load('Cirici/Blocks');
Usage
There's a Trait that does all the job, and we've created a BlockHelper
and a
BlockComponent
so you can use them easily on your CakePHP app.
To start using them, just load whatever class you want.
For the BlockHelper
, on your AppView
's initialize method, add:
// src/View/AppView.php public function initialize() { $this->loadHelper('Cirici/Blocks.Block'); }
For the BlockComponent
, on your AppController
's initialize:
// src/Controller/AppController.php public function initialize() { $this->loadComponent('Cirici/Blocks.Block'); }
Methods
Right now there are just two methods available (as said, this plugin is really simple):
get
: retrieves the entire Block entity by its slug.getContents
: just returns the Block'scontent
field contents.
Patches & Features
- Fork
- Mod, fix
- Test - this is important, so it's not unintentionally broken
- Commit - do not mess with license, todo, version, etc. (if you do change any, bump them into commits of their own that I can ignore when I pull)
- Pull request - bonus point for topic branches
Bugs & Feedback
http://github.com/ciricihq/cake-blocks/issues
License
Copyright (c) 2016, Cirici New Media and licensed under GNU GPL3 license.