mdmsoft / import
Import namespace
Installs: 43
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/mdmsoft/import
This package is not auto-updated.
Last update: 2025-10-07 14:49:25 UTC
README
Import classes under namespace and used without namespace.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require mdmsoft/import "~1.0"
for dev-master
php composer.phar require mdmsoft/import "~1.0"
or add
"mdmsoft/import": "~1.0"
to the require section of your composer.json
file.
Usage
Once the extension is installed, use in your code:
<?php Import::using('yii\bootstrap\Button'); // import yii\bootstrap\Button Import::using('yii\widgets\*'); // import all class under namespace yii\widgets Import::using('yii\bootstrap\Html', 'BootstrapHtml'); // import with alias Import::using([ 'yii\helpers\Html' => 'Html', 'yii\helpers\ArrayHelper', ]); ?> <?php echo Button::widget([ 'label' => 'Action Test', 'options' => ['class' => 'btn-lg'], ]); echo BootstrapHtml::icon('star'); ?> <?php Spaceless::begin(); ?> <div> <span>ABCDE</span> </div> <?php Spaceless::end();?> <?php $form = ActiveForm::begin()?> <?= $form->field($model,'attribute'); ?> <?php ActiveForm::end();?>