承接 guiz/bbcodeparser 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

guiz/bbcodeparser

Composer 安装命令:

composer require guiz/bbcodeparser

包简介

Parse your BBCode easy with this library. (Fork dead repo Golanka)

README 文档

README

BBCodeParser is a standalone library that parses all(?) the common bbcode tags. The easiest way to install is via composer and is equally as easy to integrate into Laravel 4

The available tags are:

  • [b][/b] Bold
  • [i][/i] Italic
  • [u][/u] Underline
  • [s][/s] Line through
  • [size=4][/size] Font size
  • [color=#eee][/color] Font color
  • [center][/center] Center
  • [quote][/quote] Quote
  • [quote=John Doe][/] Named quote
  • [url][/url] Link
  • [url=http://example.com]example.com[/url] Named link
  • [img]http://example.com]example.com/logo.png[/img] Image
  • [ol][/ol] Ordered list
  • [ul][/ul] Unordered list
  • [*] List item
  • [code][/code] Code
  • [youtube][/youtube] Youtube

Installation

The easiest way to install the BBCodeParser library is via composer. If you don´t now what composer is or how you use it you can find more information about that at their website.

Composer

You can find the BBCodeParser class via Packagist. Require the package in your composer.json file.

"guiz/bbcodeparser": "1.0.*"

Then you run install or update to download your new requirement

php composer.phar install

or

php composer.phar update

Now you are able to require the vendor/autoload.php file to PSR-0 autoload the library.

Example

// include composer autoload
require 'vendor/autoload.php';

// import the BBCodeParser Class
use Guiz\BBCode\BBCodeParser;

// Lets parse!
$bbcode = BBCodeParser::parse('[b]Bold[/b]');

If you´re a fan of Laravel 4 then the integration is made in a blink of an eye. We will go through how that is done below.

Laravel 4 integration

The BBCodeParser Class has optional Laravel 4 support and comes with a Service Provider and Facades for easy integration. After you have done the installation correctly, just follow the instructions.

Open your Laravel config file config/app.php and add the following lines.

In the $providers array add the service providers for this package.

'Guiz\BBCode\BBCodeParserServiceProvider'

Add the facade of this package to the $aliases array.

'BBCode' => 'Guiz\BBCode\Facades\BBCodeParser'

Now the BBCodeParser Class will be auto-loaded by Laravel.

Example

By default all tags will be parsed

BBCode::parse('[b]bold[/b][i]italic[/i]');

If you would like to use only some tags when you parse you can do that by doing like this

// In this case the [i][/i] tag will not be parsed
BBCode::only('bold')->parse('[b]bold[/b][i]italic[/i]');

or

// In this case all tags except [b][/b] will be parsed
BBCode::except('bold')->parse('[b]bold[/b][i]italic[/i]');

Custom Parsers

You can add new custom parsers or overwrite existing parsers.

// name, pattern, replace
BBCode::setParser('mailurl', '/\[mailurl\](.*)\[\/mailurl\]/', '<a href="mailto:$1">$1</a>');

guiz/bbcodeparser 适用场景与选型建议

guiz/bbcodeparser 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.11k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 02 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「parser」 「laravel」 「bbcode」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 guiz/bbcodeparser 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 guiz/bbcodeparser 我们能提供哪些服务?
定制开发 / 二次开发

基于 guiz/bbcodeparser 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-07