定制 andrew72ru/yii2-typographer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

andrew72ru/yii2-typographer

Composer 安装命令:

composer require andrew72ru/yii2-typographer

包简介

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

README 文档

README

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

Installation

The preferred way to install this extension is through composer.

Either run

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

or add

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

to the require section of your composer.json file.

Setup

Set up you application components:

    '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:

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

If your text with \n or markdown text

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

统计信息

  • 总下载量: 320
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-23