项目作者: ScaryDonetskiy

项目描述 :
Phalcon plugin for checking access by HTTP Method of request.
高级语言: PHP
项目地址: git://github.com/ScaryDonetskiy/Phalcon-HTTP-Methods-Plugin.git
创建时间: 2019-01-04T10:33:14Z
项目社区:https://github.com/ScaryDonetskiy/Phalcon-HTTP-Methods-Plugin

开源协议:BSD 2-Clause "Simplified" License

下载


HTTP Methods Plugin for Phalcon PHP

Packagist
PHP from Packagist
Packagist
GitHub Issues
Scrutinizer Code Quality
Travis CI Status

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.

  1. $dispatcher = new \Phalcon\Mvc\Dispatcher();
  2. $eventManager = new \Phalcon\Events\Manager();
  3. $eventManager->attach('dispatch:beforeExecuteRoute', new \Vados\PhalconPlugins\HTTPMethodsPlugin());
  4. $dispatcher->setEventsManager($eventManager);

And just take annotations to controllers actions

  1. class FooController extends \Phalcon\Mvc\Controller
  2. {
  3. /**
  4. * @Method(GET, POST, PUT, DELETE)
  5. */
  6. public function barAction()
  7. {
  8. return 'foobar';
  9. }
  10. }

Installation

Use composer for installation

  1. composer require vados/phalcon-http-methods-plugin

Contribution guidelines

  • Writing tests
  • Code review
  • Guidelines accord