PHP code example of ciniran / yii2-dic
1. Go to this page and download the library: Download ciniran/yii2-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/ */
ciniran / yii2-dic example snippets
`
php composer.phar
`
$array = Yii::$app->dic->getAllKeys(); //通过缓存取得
$array = Yii::$app->dic->getAllKeys(false); //不通过缓存取得
`
$array =Yii::$app->dic->getKey('base_status'); //通过缓存取得
$array =Yii::$app->dic->getKey('base_status',true); //获得已被禁用的项目