aldaflux/fine-diff-bundle
最新稳定版本:v2.3.1
Composer 安装命令:
composer require aldaflux/fine-diff-bundle
包简介
FineDiff Symfony Bundle implementation
关键字:
README 文档
README
Original fine diff library:
- https://github.com/webtown-php/fine-diff-bundle
- https://github.com/gorhill/PHP-FineDiff
- http://www.raymondhill.net/finediff/viewdiff-ex.php
Installation
Add to composer
Run in command line:
$ composer require AlDaFlux/fine-diff-bundle
Or add with hand to composer.json:
"require": { "AlDaFlux/fine-diff-bundle": "~1.10" }
Register the bundle
Add the app
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new AlDaFlux\FineDiffBundle\AlDaFluxPHPFineDiffBundle(), ); }
Configure
Optional. You can change the default granularity.
# app/config/config.yml AlDaFlux_fine_diff: default_granularity: character # This is the default granularity. Alternatives: 'word', 'sentence' and 'paragraph'
Usage
There are two twig function:
renderDiff(): compare two stringsrenderHtmlTextDiff(): compare two strings which contain HTML tags. Remove tags withstrip_tagsbefore compare strings
{{ renderDiff(oldValue, newValue) }}
{{ renderDiff(oldValue, newValue, 'word') }}
{{ renderHtmlTextDiff(oldValue, newValue) }}
{{ renderHtmlTextDiff(oldValue, newValue, 'sentence') }}
统计信息
- 总下载量: 8.74k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-03