protected function applyFormats($data)
    {
        if ($this->getOptions()->getOutputFormatters()) {

            foreach ($this->getOptions()->getOutputFormatters() as $formatter) {
                if ($formatter instanceof FormatterInterface) {
                    /** @var $formatter \PageBuilder\FormatterInterface */
                    $data = $formatter->format($data);
                } elseif (is_callable($formatter)) {
                    $data = $formatter($data, $this->serviceManager);
                }
            }
        }

        return $data;
    }
protected function applyFormats($data)
    {
        if ($this->getOptions()->getOutputFormatters()) {

            foreach ($this->getOptions()->getOutputFormatters() as $formatter) {
                if ($formatter instanceof FormatterInterface) {
                    /** @var $formatter \PageBuilder\FormatterInterface */
                    $data = $formatter->format($data);
                } elseif (is_callable($formatter)) {
                    $data = $formatter($data, $this->serviceManager);
                }
            }
        }

        return $data;
    }
protected function applyFormats ( $ data ) { if ( $ this -> getOptions ( ) -> getOutputFormatters ( ) ) { foreach ( $ this -> getOptions ( ) -> getOutputFormatters ( ) as $ formatter ) { if ( $ formatter instanceof FormatterInterface ) { /** @var $formatter \PageBuilder\FormatterInterface */ $ data = $ formatter -> format ( $ data ) ; } elseif ( is_callable ( $ formatter ) ) { $ data = $ formatter ( $ data , $ this -> serviceManager ) ; } } } return $ data ; }
Apply formatter using the formatters in the order they were defined

@param $data

@return string
Apply formatter using the formatters in the order they were defined