Skip to content
This repository was archived by the owner on Dec 6, 2025. It is now read-only.

Latest commit

 

History

History
51 lines (40 loc) · 1.77 KB

File metadata and controls

51 lines (40 loc) · 1.77 KB

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