PHP code example of phalcon-framwork / plugins

1. Go to this page and download the library: Download phalcon-framwork/plugins 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/ */

    

phalcon-framwork / plugins example snippets

 php
$di->setShared('dispatcher', function () {
    $dispatcherConfig = $this->getConfig()->services->dispatcher;
    $dispatcher = new Dispatcher();
    if (isset($dispatcherConfig->module_default_namespaces)) {
        $dispatcher->setDefaultNamespace($dispatcherConfig->module_default_namespaces);
    }
    $eventsManager = new EventsManager();
    $dispatcherPlugin = new DIspatcherPlugin($dispatcherConfig->toArray());
    $eventsManager->attach('dispatch', $dispatcherPlugin);
    $dispatcher->setEventsManager($eventsManager);
    return $dispatcher;
});