vados / phalcon-http-methods-plugin
Phalcon plugin for checking access by HTTP Method of request
0.1
2019-01-04 10:44 UTC
Requires
- php: >=7.1.0
- ext-phalcon: >=3.2
Requires (Dev)
- phalcon/ide-stubs: v3.2.1
- phpunit/phpunit: ^7.0@dev
This package is auto-updated.
Last update: 2024-11-25 08:25:54 UTC
README
Phalcon plugin for checking access by HTTP Method of request.
You can select one or more HTTP methods for action availability from this: GET, POST, PUT, DELETE.
Works with PHP 7.1+
Usage
Plugin require availability 'Annotations' and 'Request' components in application DI container.
$dispatcher = new \Phalcon\Mvc\Dispatcher(); $eventManager = new \Phalcon\Events\Manager(); $eventManager->attach('dispatch:beforeExecuteRoute', new \Vados\PhalconPlugins\HTTPMethodsPlugin()); $dispatcher->setEventsManager($eventManager);
And just take annotations to controllers actions
class FooController extends \Phalcon\Mvc\Controller { /** * @Method(GET, POST, PUT, DELETE) */ public function barAction() { return 'foobar'; } }
Installation
Use composer for installation
composer require vados/phalcon-http-methods-plugin
Contribution guidelines
- Writing tests
- Code review
- Guidelines accord