https://github.com/scarydonetskiy/phalcon-http-methods-plugin
Phalcon plugin for checking access by HTTP Method of request.
https://github.com/scarydonetskiy/phalcon-http-methods-plugin
http http-method mvc phalcon phalcon-plugin php php7 phpunit-tests plugin
Last synced: 3 months ago
JSON representation
Phalcon plugin for checking access by HTTP Method of request.
- Host: GitHub
- URL: https://github.com/scarydonetskiy/phalcon-http-methods-plugin
- Owner: ScaryDonetskiy
- License: bsd-2-clause
- Created: 2019-01-04T10:33:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-24T09:43:09.000Z (over 6 years ago)
- Last Synced: 2025-02-14T12:27:11.936Z (5 months ago)
- Topics: http, http-method, mvc, phalcon, phalcon-plugin, php, php7, phpunit-tests, plugin
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HTTP Methods Plugin for Phalcon PHP #




[](https://scrutinizer-ci.com/g/ScaryDonetskiy/Phalcon-HTTP-Methods-Plugin/?branch=master)
[](https://travis-ci.org/ScaryDonetskiy/Phalcon-HTTP-Methods-Plugin)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.
```php
$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
```php
class FooController extends \Phalcon\Mvc\Controller
{
/**
* @Method(GET, POST, PUT, DELETE)
*/
public function barAction()
{
return 'foobar';
}
}
```### Installation ###
Use composer for installation
```bash
composer require vados/phalcon-http-methods-plugin
```### Contribution guidelines ###
* Writing tests
* Code review
* Guidelines accord