Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/scarydonetskiy/phalcon-http-methods-plugin
- Owner: ScaryDonetskiy
- License: bsd-2-clause
- Created: 2019-01-04T10:33:14.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-24T09:43:09.000Z (almost 6 years ago)
- Last Synced: 2024-12-05T02:46:53.246Z (23 days 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 #
![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