Yii2 Ace
, (*1)
Ace admin theme for Yii2., (*2)
Installation
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
$ composer require cornernote/yii2-ace "*"
or add, (*5)
"cornernote/yii2-ace": "*"
to the require
section of your composer.json
file., (*6)
Add the following to your AppAsset.php
:, (*7)
class AppAsset extends AssetBundle
{
public $depends = [
'cornernote\ace\web\AceAsset',
];
}
Example Layout
An example Yii2 layout exists at views/layouts/main.php
., (*8)
You can use it directly by pasting the following into your views/layouts/main.php
:, (*9)
use app\assets\AppAsset;
AppAsset::register($this);
$viewPath = '@vendor/cornernote/yii2-ace/src/views/layouts';
$regex = '|(\\' . DIRECTORY_SEPARATOR . '[^\\' . DIRECTORY_SEPARATOR . ']*\\' . DIRECTORY_SEPARATOR . '[^\\' . DIRECTORY_SEPARATOR . ']*\.php)$|';
preg_match($regex, __FILE__, $matches);
require(Yii::getAlias('@vendor/cornernote/yii2-ace/src/views' . $matches[1]));