Text Helpers
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist dkulinich/yii2-texthelpers "*"
or add
"dkulinich/yii2-texthelpers": "dev-master"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
use dkulinich\texthelpers\ExtCoreTextHelper;
// Cut string at words
<?= ExtCoreTextHelper::cutTextAtWords($text, $max_length = NULL); ?>
// Transliterate string
<?= ExtCoreTextHelper::transliterate_cyr($text, $replaceWhitespaces = '_', $acceptedSymbols = '0-9a-zA-Z_'); ?>