定制 bfolliot/zf-nl2br 二次开发

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

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

bfolliot/zf-nl2br

最新稳定版本:1.0.0

Composer 安装命令:

composer require bfolliot/zf-nl2br

包简介

Provides a ZF2 filter for the php nl2br function

README 文档

README

Provides a ZF2 filter for the php nl2br function

Installation

BFolliot\Zf-Nl2br is available through composer. Add "BFolliot/Zf-Nl2br" to your composer.json list. You can specify the latest stable version of BFolliot\Zf-Nl2br:

"BFolliot\Zf-Nl2br": "1.0.*"

To enable the module in your config/application.config.php file, add an entry BFolliot\ZfNl2br to the list of enabled modules.

Usage

In your input filter configuration, add the nl2br filter to filter the result. An example form:

namespace Application\Form;

use Zend\InputFilter;
use Zend\Form\Form;

class Foo extends Form implements
    InputFilter\InputFilterProviderInterface
{
    public function __construct($name = null)
    {
        parent::__construct($name);

        $this->add(array(
            'name'    => 'text',
            'options' => array(
                'label' => 'Text'
            ),
            'attributes' => array(
                'type'  => 'textarea',
            ),
        ));
    }

    public function getInputFilterSpecification()
    {
        return array(
            'text'  => array(
                'required' => true,
                'filters'  => array(
                    array('name' => 'nl2br'),
                ),
            ),
        );
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-04-12