PHP code example of vados / phalcon-http-methods-plugin

1. Go to this page and download the library: Download vados/phalcon-http-methods-plugin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vados / phalcon-http-methods-plugin example snippets


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

class FooController extends \Phalcon\Mvc\Controller
{
    /**
     * @Method(GET, POST, PUT, DELETE)
     */
    public function barAction()
    {
        return 'foobar';
    }
}