neo-framework / neo-plugins
This package is abandoned and no longer maintained.
No replacement package was suggested.
Awesome plug-ins for Neo Framework
dev-master
2017-09-20 20:20 UTC
Requires (Dev)
- neo-framework/neo-core: dev-master
- phpunit/phpunit: ^6.3
This package is not auto-updated.
Last update: 2018-11-25 23:59:05 UTC
README
Awesome plug-ins for Neo Framework 🌲
Usage
- Install the package using composer.
composer require neo-framework/neo-plugins
- Add these entries to your
config/plugins.config.php
file.
'plugins' => [
'forwarder' => '\\neo\\plugins\\controller\\ForwarderPlugin'
]
- Dynamically load a plug-in in the controller at runtime.
$this->load('plugin');
Plug-ins
Forwarder
The forwarder
plug-in is a controller extension that allows you to forward a request to another route.
A nice use case is redirecting to a login page when you are not signed in already.
class SuperSecretController extends Controller { public function super_secret_action() { if (not signed in) { $this->load('forwarder'); return $this->forward('/login'); } // super secret stuff... } }