PHPackages                             loveorigami/yii2-shortcodes-pack - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. loveorigami/yii2-shortcodes-pack

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

loveorigami/yii2-shortcodes-pack
================================

Shortcodes collection as WP for Yii2

1.3(8y ago)259723[6 issues](https://github.com/loveorigami/yii2-shortcodes-pack/issues)MITPHP

Since Jan 12Pushed 6y ago3 watchersCompare

[ Source](https://github.com/loveorigami/yii2-shortcodes-pack)[ Packagist](https://packagist.org/packages/loveorigami/yii2-shortcodes-pack)[ RSS](/packages/loveorigami-yii2-shortcodes-pack/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Yii2-shortcodes-pack
====================

[](#yii2-shortcodes-pack)

[![Latest Stable Version](https://camo.githubusercontent.com/0f5000793a1bce694a1828f50ee1d6c878265e23ce839c2cba29907e239f2b01/68747470733a2f2f706f7365722e707567782e6f72672f6c6f76656f726967616d692f796969322d73686f7274636f6465732d7061636b2f762f737461626c65)](https://packagist.org/packages/loveorigami/yii2-shortcodes-pack)[![Total Downloads](https://camo.githubusercontent.com/d9d8da6c34c18f9e87bbd8fb147a0a0c974088c85769270688c5adf7613b5294/68747470733a2f2f706f7365722e707567782e6f72672f6c6f76656f726967616d692f796969322d73686f7274636f6465732d7061636b2f646f776e6c6f616473)](https://packagist.org/packages/loveorigami/yii2-shortcodes-pack)[![License](https://camo.githubusercontent.com/4700394925b2d4dc88ce7046c1bd4fea1768c080d2f9d7954f454a94c5d94ca2/68747470733a2f2f706f7365722e707567782e6f72672f6c6f76656f726967616d692f796969322d73686f7274636f6465732d7061636b2f6c6963656e7365)](https://packagist.org/packages/loveorigami/yii2-shortcodes-pack)

Yii2-shortcodes-pack is part of the [Yii2-plugins-system](https://github.com/loveorigami/yii2-plugins-system) that have more usefull shortcodes for our site

[!["Shortcodes"](docs/img/shortcodes.jpg)](docs/img/shortcodes.jpg)

0. Shortcodes in pack
---------------------

[](#0-shortcodes-in-pack)

ShortcodeDescriptionUsageCodeytYouTube link on original video\[yt code="\*"\] Link on video \[/yt\][see](src/web/youtube)youtubeEmbed YouTube video with parameters\[youtube code="*" w="*" h="\*"\][see](src/web/youtube)codeAll the blocks of text enclosed in the shortcode \[code\], will be highlighted\[code style="*" lang="*"\] ... \[/code\][see](src/content/codehighlight)containerBootstrap 3 grid - container (default or fluid)\[container\] ... \[/container\][see](src/bootstrap#grid)rowBootstrap 3 grid - row\[row\] ... \[/row\][see](src/bootstrap#grid)colBootstrap 3 grid - column (lg, md, sm, xs)\[col md=6\] ... \[/col\][see](src/bootstrap#grid)alertBootstrap 3 alert messages\[alert close=1\] ... \[/alert\][see](src/bootstrap#alerts)labelBootstrap 3 labels\[label text="\*"\][see](src/bootstrap#label)tabsBootstrap 3 tabs or pills\[tabs\] \[tab\] ... \[/tab\] \[/tabs\][see](src/bootstrap#tabs)and more in future releases...

### How create my shortcode?

[](#how-create-my-shortcode)

- It is very easy! [See instruction](docs/create_shortcode.md)

---

1. Download
-----------

[](#1-download)

Yii2-shortcodes-pack be installed using composer. Run following command to download and install Yii2-shortcodes-pack:

```
composer require "loveorigami/yii2-shortcodes-pack":"*"
```

2. Update database schema
-------------------------

[](#2-update-database-schema)

The last thing you need to do is updating your database schema by applying the migrations. Make sure that you have properly configured db application component and run the following command:

```
$ php yii migrate/up --migrationPath=@vendor/loveorigami/yii2-plugins-system/migrations

```

3. Configure application
------------------------

[](#3-configure-application)

Let's start with defining module in `@backend/config/main.php`:

```
'modules' => [
    'plugins' => [
        'class' => 'lo\plugins\Module',
        'pluginsDir'=>[
            '@lo/plugins/core', // default dir with core plugins
			'@lo/shortcodes' // dir with shortcodes pack
            '@common/shortcodes', // dir with our plugins with shortcodes
        ]
    ],
],
```

That's all, now you have module installed and configured in advanced template.

Next, open `@frontend/config/main.php` and add following:

```
...
'components' => [
    'plugins' => [
        'class' => lo\plugins\components\PluginsManager::class,
        'appId' => 1 // lo\plugins\BasePlugin::APP_FRONTEND,
        // by default
        'enablePlugins' => true,
        'shortcodesParse' => true,
        'shortcodesIgnoreBlocks' => [
            ']*>' => '',
            //'
