PHP code example of webchemistry / di-decorator

1. Go to this page and download the library: Download webchemistry/di-decorator 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/ */

    

webchemistry / di-decorator example snippets



use Nette\DI\CompilerExtension;
use WebChemistry\Decorator\Decorator;

class CustomExtension extends CompilerExtension {

	public function beforeCompile() {
    		$decorator = new Decorator($this->getContainerBuilder());
    
			$decorator->decorate(BaseGrid::class)
				->addSetup('injectComponents')
				->addTags(['tag']);
	}

}