PHP code example of janschumann / dic
1. Go to this page and download the library: Download janschumann/dic 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/ */
janschumann / dic example snippets
variable_set('dic_root_dir', '<path/to/cache/dir>');
$dispatcher = drupal_dic()->get('event_dispatcher');
drupal_dic()->get('event_dispatcher')->dispatch('<my_event_name>', <the event class>);
/**
* Implements @see hook_dic_bundle_info()
*/
function <my_module>_dic_bundle_info() {
return array('bundles' => array("\\MyNamespace\\MyBundle\\Bundle\\MyBundle\\MyBundle"));
}
dic.api.php