Skip to content
Benneette edited this page Jan 23, 2018 · 2 revisions

A library is a files package that can have a config folder with loader and router files to include some route and dependencies regitration.

Example : librairies/sample/config/loader.php

// need to use $object variable and set second param to true to not erase others registrations.
$object->registerClasses([
    'SampleController' => dirname(__FILE__).'/SampleController.php',
], true);

librairies/scrud/config/router.php

// need to use $object variable
$object->addPost("/sample/{name}/:action",[
    'controller' => 'api',
    'action'     => 2
]);

config/config.php

'libraries' => ['sample'],