1. Go to this page and download the library: Download vikkio88/nicu 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/ */
// $config being an instance of Config
$config->get('someStuff', 'fallback value');
class MyAction extends ApiAction {
public function __construct(Config $config)
{
$this->config = $config;
}
protected function action(): array
{
return [
'test' => $this->config->get('stuff')
];
}
}
class SampleProvider extends Provider
{
public function boot()
{
$this->bind(Interface::class, function(ContainerInterface $c){
return new Implementation($c->get(AnotherInterface::class));
});
}
}