aldaflux/fine-diff-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

aldaflux/fine-diff-bundle

最新稳定版本:v2.3.1

Composer 安装命令:

composer require aldaflux/fine-diff-bundle

包简介

FineDiff Symfony Bundle implementation

README 文档

README

Original fine diff library:

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 strings
  • renderHtmlTextDiff(): compare two strings which contain HTML tags. Remove tags with strip_tags before compare strings
{{ renderDiff(oldValue, newValue) }}
{{ renderDiff(oldValue, newValue, 'word') }}

{{ renderHtmlTextDiff(oldValue, newValue) }}
{{ renderHtmlTextDiff(oldValue, newValue, 'sentence') }}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-03