定制 greywolfs/fine-diff-bundle 二次开发

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

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

greywolfs/fine-diff-bundle

Composer 安装命令:

composer require greywolfs/fine-diff-bundle

包简介

FineDiff Symfony3 Bundle implementation

README 文档

README

Original fine diff library:

Installation

Add to composer

Run in command line:

$ composer require greywolfs/fine-diff-bundle

Or add with hand to composer.json:

    "require": {
        "greywolfs/fine-diff-bundle": "~1.10"
    }

Register the bundle

Add the app

<?php
    // app/AppKernel.php
    
    public function registerBundles()
	{
		$bundles = array(
			// ...
			new Greywolfs\FineDiffBundle\GreywolfsPHPFineDiffBundle(),
		);
	}

Configure

Optional. You can change the default granularity.

# app/config/config.yml

greywolfs_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') }}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固