dev-master
9999999-dev
MIT
The Requires
The Development Requires
0.1.1
0.1.1.0
MIT
The Requires
The Development Requires
0.1.0
0.1.0.0
The Requires
The Development Requires
Yii2 behavior for rendering widgets with WordPress style shortcodes., (*2)
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
$ php composer.phar require alexeevdv/yii2-shortcodes "~0.1.0"
or add, (*5)
"alexeevdv/yii2-shortcodes": "~0.1.0"
to the require
section of your composer.json
file., (*6)
use alexeevdv\yii\shortcodes\ShortcodeBehavior; //... 'components' => [ //... 'view' => [ 'as shortcodeBehavior' => ShortcodeBehavior::class, 'map' => [ 'feedback' => \frontend\widgets\ContactForm::class, 'gallery' => [ 'class' => \frontend\widgets\GalleryWidget::class, 'theme' => 'dark', ], ], ], //... ], //...
namespace frontend\widgets; class GalleryWidget extends \yii\base\Widget { public $id; public $theme; public function run() { // render your gallery here using $id and $theme } }
//Anywhere in your layouts, views or rendered content: [gallery id=413]
MIT
MIT