1. Go to this page and download the library: Download crisu83/yii-extension 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/ */
crisu83 / yii-extension example snippets
Yii::import('vendor.crisu83.yii-extension.behaviors.*');
MyWidget extends CWidget
{
public function init()
{
parent::init();
$this->attachBehavior('ext', new WidgetBehavior);
}
}
Yii::import('vendor.crisu83.yii-extension.behaviors.*');
MyApplicationComponent extends CApplicationComponent
{
public function init()
{
parent::init();
$this->attachBehavior('ext', new ComponentBehavior);
}
}
$this->createPathAlias('myExtension', __DIR__);
$this->import('MyClass');
$myClass = new MyClass;
Yii::import('vendor.crisu83.yii-extension.behaviors.*');
MyModule extends CWebModule
{
public function init()
{
parent::init();
$this->attachBehavior('ext', new ModuleBehavior);
}
}