mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-27 07:00:29 +01:00
32 lines
620 B
PHP
32 lines
620 B
PHP
<?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);
|
|
}
|
|
}
|