Skip to content

ScaryDonetskiy/Phalcon-HTTP-Methods-Plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

$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