Commit e8129407 authored by Michal Cygankiewicz's avatar Michal Cygankiewicz

remove FormatViewHelper - not used and not usable in current state

parent 11349be6
Pipeline #7784 failed with stages
in 19 seconds
<?php
namespace T3o\TerFe2\ViewHelpers;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Format view helper
*/
class FormatViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{
/**
* Disable the escaping interceptor
*/
protected $escapingInterceptorEnabled = false;
/**
* Formats content with given function
*
* @param string $function Function to format the content
* @param mixed $content Content
* @return string Formated content
* @throws \Exception
*/
public function render($function, $content = null)
{
if ($content === null) {
$content = $this->renderChildren();
}
if (empty($function) || !function_exists($function)) {
throw new \Exception('Function "' . $function . '" not found to modify content');
}
if (!is_string($content) && !is_array($content)) {
throw new \Exception('"' . ucfirst(gettype($content)) . '" is not an allowed type in format view helper');
}
if (is_array($content)) {
return call_user_func_array($function, $content);
}
return call_user_func($function, $content);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment