1. Go to this page and download the library: Download srag/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/ */
srag / dic example snippets
//...
use srag\DIC\DICTrait;
//...
class x {
//...
use DICTrait;
//...
const PLUGIN_CLASS_NAME = ilXPlugin::class;
//...
}
/**
* Get HTML of GUI
*
* @param string|object $html HTML code or some GUI instance
*
* @return string HTML
*
* @throws DICException
*/
self::output()->getHTML($value): string;
/**
* Translate text
*
* @param string $key Language key
* @param string $module Language module
* @param array $placeholders Placeholders in your language texst to replace with vsprintf
* @param bool $plugin Plugin language or ILIAS core language?
* @param string $lang Possibly specific language, otherwise current language, if empty
* @param string $default Default text, if language key not exists
*
* @return string Translated text
*
* @throws DICException
*/
self::plugin()->translate(string $key, string $module = "", array $placeholders = [], bool $plugin = true, string $lang = "", string $default = "MISSING %s"): string;
/**
* Get ILIAS plugin object instance
*
* Please avoid to use ILIAS plugin object instance and instead use methods in this class!
*
* @return ilPlugin ILIAS plugin object instance
*/
self::plugin()->getPluginObject(): ilPlugin;
/**
* Get version interface
*
* @return VersionInterface Version interface
*/
self::version(): VersionInterface;
use srag\DIC\x\DICStatic;use srag\Plugins\x\x\x;DICStatic::dic()->database()->createAutoIncrement(x::TABLE_NAME, "id");