Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 6 days ago
JSON representation

Phalcon plugin for checking access by HTTP Method of request.

Awesome Lists containing this project

README

        

# HTTP Methods Plugin for Phalcon PHP #

![Packagist](https://img.shields.io/packagist/l/vados/phalcon-http-methods-plugin.svg)
![PHP from Packagist](https://img.shields.io/packagist/php-v/vados/phalcon-http-methods-plugin.svg)
![Packagist](https://img.shields.io/packagist/dt/vados/phalcon-http-methods-plugin.svg)
![GitHub Issues](https://img.shields.io/github/issues-raw/ScaryDonetskiy/Phalcon-HTTP-Methods-Plugin.svg)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ScaryDonetskiy/Phalcon-HTTP-Methods-Plugin/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ScaryDonetskiy/Phalcon-HTTP-Methods-Plugin/?branch=master)
[![Travis CI Status](https://travis-ci.org/ScaryDonetskiy/Phalcon-HTTP-Methods-Plugin.svg?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