sharkzt/helpersbundle 问题修复 & 功能扩展

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

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

sharkzt/helpersbundle

Composer 安装命令:

composer require sharkzt/helpersbundle

包简介

Helpers bundle, that extends symfony validator, html purifier classes for easy usage

README 文档

README

SharztHelpersBundle is a bundle, that extends symfony validator, html purifier classes for easy usage. It is easy to use, and extensively unit tested!

Build Status Coverage Status

Installation

The recommended way to install bundle is through Composer:

$ composer require sharkzt/helpersbundle

Usage Examples

Validation

// Feel free to use as service like $validationHelper = $this->get('sharkzt_helpers.validation_helper');
$id = 111;
$email = "test@mail";
$validationHelper = new ValidationHelper(new ErrorHelper());
$validationHelper->setParameter([$id, $validationHelper->integer])
                 ->setParameter([$id, new Choice([1, 2, 3])])
                 ->setParameter([$email, new Email()]);
                 
if (!$validationHelper->validate()) {
    return $this->view($validationHelper->getResponse());
}

The ValidationHelper returns an array of errors if validation fails.

Purification

//Set up your service $purifierHelper = $this->get('sharkzt_helpers.purifier_helper');
$purifierHelper = new PurifierHelper();
$purifier = $purifierHelper->initialize();
$xssCode = "<script>alert('Xss');</script>Hello world!"

//Purify your variable, to avoid any html code in
$pureString = $purifier->purify($xssCode);

The $pureString returns Hello world!.

License

HelpersBundle is released under the MIT License. See the bundled LICENSE file for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固