Repository URL to install this package:
|
Version:
1.0.1 ▾
|
<?php
namespace ZF2Bbcode\View\Helper;
use Decoda\Decoda;
use Zend\View\Helper\AbstractHelper;
use Zend\ServiceManager\ServiceLocatorAwareTrait;
class Bbcode extends AbstractHelper
{
use ServiceLocatorAwareTrait;
public function __invoke($bbcodeString)
{
/* @var $bbcode Decoda */
$bbcode = $this->getServiceLocator()->getServiceLocator()->get(Decoda::class);
$bbcode->reset($bbcodeString);
return $bbcode->parse();
}
}