Yii 2.0: yii2-hyphenator

A simple wrapper for Hyphenator.js
3 followers

A simple wrapper for Hyphenator.js. It automatically hyphenates texts.

Requirements

  • Yii2

Usage

  • Install this extension via composer:
composer require drenty/yii2-hyphenator
  • Register the widget in your view (do not echo it):
Hyphenator::widget([
    'language' => 'en',
    'pluginOptions' => [
        'minwordlength' => 4
    ]
]);
  • Add class="hyphenate" to the elements whose text should be hyphenated (children do inherit this setting). Hyphenation can be stopped by adding class="donthyphenate".

GitHub

https://github.com/drenty/yii2-hyphenator

To come

  • Support for Hyphenator_Loader.js

Be the first person to leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet