mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Adding twig filter for csv cell content - refs #401
This commit is contained in:
parent
a10ca2dec4
commit
88cb918c82
@ -35,9 +35,21 @@ class TranslatableStringTwig extends \Twig_Extension
|
||||
public function getFilters()
|
||||
{
|
||||
return array(
|
||||
new \Twig_SimpleFilter('localize_translatable_string', array($this, 'localize'))
|
||||
new \Twig_SimpleFilter('localize_translatable_string', array($this, 'localize')),
|
||||
new \Twig_SimpleFilter(
|
||||
'csv_cell',
|
||||
array($this, 'csvCellFilter'),
|
||||
array('is_safe' => array('html')))
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
public function csvCellFilter($content)
|
||||
{
|
||||
return str_replace('"', '""', $content);
|
||||
}
|
||||
|
||||
public function localize(array $translatableStrings)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user