2017 © Pedro Peláez
 

yii2-extension yii2-typographer

Typographer for Yii2 based on Evgeny Muravjev Typograph, http://mdash.ru

image

andrew72ru/yii2-typographer

Typographer for Yii2 based on Evgeny Muravjev Typograph, http://mdash.ru

  • Thursday, June 18, 2015
  • by andrew72ru
  • Repository
  • 1 Watchers
  • 0 Stars
  • 147 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 7 % Grown

The README.md

Smart typographer for Yii2

Typographer based on Evgeny Muravjev Typograph, http://mdash.ru, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist andrew72ru/yii2-typographer "dev-master"

or add, (*4)

"andrew72ru/yii2-typographer": "dev-master"

to the require section of your composer.json file., (*5)

Setup

Set up you application components:, (*6)

    'components' => [
        …
        'typographer' => [
            'class' => 'andrew72ru\typographer\Typographer',
            'params' => [
                'Text.paragraphs' => 'off',
                'Text.breakline' => 'off',
                'OptAlign.oa_oquote' => 'on',
                'OptAlign.oa_obracket_coma' => 'on',
                'OptAlign.oa_oquote_extra' => 'on',
                'Number.math_chars' => 'on',
                // Other parametrs – see http://mdash.ru
            ],
            'markdown' => true, // Whether to use yii\helpers\Markdown to convert text
            'markdownType' => 'gfm' // what type of markdown use in converter
        ]
    ]

Usage

If your text is in paragraph, and you don’t need to convert this to other paragraphs:, (*7)

<p class="lead"><?= Yii::$app->typographer->directTypo($text)?></p>

If your text with \n or markdown text, (*8)

<?= Yii::$app->typographer->typo($text) ?>

The Versions

18/06 2015

dev-master

9999999-dev

Typographer for Yii2 based on Evgeny Muravjev Typograph, http://mdash.ru

  Sources   Download

MIT

The Requires

 

by Avatar andrew72ru

extension yii2 typographer