ignatenkovnikita / yii2-template-messages
Template Message with placeholder
Installs: 5 263
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-11-29 04:57:57 UTC
README
Template Message with placeholder
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist ignatenkovnikita/yii2-template-messages "*"
or add
"ignatenkovnikita/yii2-template-messages": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
'modules'=>[ 'template' => [ 'class' => 'ignatenkovnikita\template\Module', ], ],
In Code uses
Template::replace('template_name', [ 'your_variable' => 'value ]);
Example Add in migration
$rows = [ [ 'promo-code-send', 'Отправка купона пользователю', '["promo_code"]', 'Трэк {promo_code}' ], ]; $this->batchInsert('{{template}}', ['id', 'title', 'placeholders', 'message'], $rows); $this->update('{{%template}}',['widget_options' => '{"toolbar":false,"pastePlainText":true,"buttonSource":true,"paragraphize":false}']);
Apply migration
./console/yii migrate --migrationPath=vendor/ignatenkovnikita/yii2-template-messages/migrations/
TODO
- add suppport email
- refactoring