OpenXE/classes/Modules/TransferSmartyTemplate/TemplateHelper/CommonHelper.php

32 lines
620 B
PHP
Raw Normal View History

2021-05-21 08:49:41 +02:00
<?php
namespace Xentral\Modules\TransferSmartyTemplate\TemplateHelper;
final class CommonHelper
{
/**
* @param string $string
* @param string $replaceChar
*
* @return string
*/
public function replaceLineBreaks($string, $replaceChar = ' ')
{
return (string)preg_replace("/\r\n|\r|\n/", (string)$replaceChar, (string)$string);
}
/**
* Dumps a template variable
*
* @example {$var|dump}
*
* @param mixed $data
*
* @return string
*/
public function dumpVariable($data)
{
return var_export($data, true);
}
}