-1
フォームのフィルタとしてhtmlpurifierを使用します。 zf2 - > zf3の移行後は動作しません。 "プラグインマネージャZend \ Filter \ FilterPluginManagerに" htmlpurifier "という名前のプラグインが見つかりませんでした。モジュールの設定では、htmlpurifierが存在します。 PostFieldsetがフィールドセットがInputFilterProviderInterfaceを実装延びHTMLPurifierが機能しません
クラス:
public function __construct(PostInterface $post, HydratorInterface $hydrator, $name = "post", $options = array())
parent::__construct($name, $options);
$this->setHydrator($hydrator);
$this->setObject($post);
...
$this->add(array(
'type' => 'textarea',
'name' => 'text',
'attributes'=>array(
'class' => 'form-control',
'required' => 'required',
'rows' => '3',
),
'options' => array(
'label' => 'The text'
)
));
パブリック関数getInputFilterSpecification():zenddevelopertoolsで
return array(
'text' => array(
'required' => true,
'filters'=>array(
array(
'name' => 'htmlpurifier'
),
),
'validators' => array(
array(
'name'=>'StringLength',
'options'=>array(
'encoding'=>'UTF-8',
'min'=>1,
'max'=>250000,
)
)
)
),
モジュールの設定:
'filters' =>
array (size=2)
'factories' =>
array (size=1)
'Soflomo\Purifier\PurifierFilter' => string 'Soflomo\Purifier\Factory\PurifierFilterFactory' (length=46)
'aliases' =>
array (size=1)
'htmlpurifier' => string 'Soflomo\Purifier\PurifierFilter' (length=31)
https://bitbucket.org/mad-max/blog-note3