PHP code example of oxidprojects / dependency-injection
1. Go to this page and download the library: Download oxidprojects/dependency-injection 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/ */
oxidprojects / dependency-injection example snippets
class Controller extends FrontendController
{
public function render()
{
$output = project_container()->get(ModuleOutput::class);
$this->addTplParam('title', $output->html('Hello dependency injection'));
return 'template';
}
}