mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 16:43:48 +00:00
Move csvCellFilter into Templating\CSVCellTwig - close #416
This commit is contained in:
@@ -29,26 +29,16 @@ class TranslatableStringTwig extends \Twig_Extension
|
||||
use ContainerAwareTrait;
|
||||
|
||||
/*
|
||||
* Returns a list of filters to add to the existing list.
|
||||
*
|
||||
* (non-PHPdoc)
|
||||
* @see Twig_Extension::getFilters()
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
return array(
|
||||
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);
|
||||
'localize_translatable_string', array($this, 'localize')));
|
||||
}
|
||||
|
||||
public function localize(array $translatableStrings)
|
||||
@@ -57,6 +47,11 @@ class TranslatableStringTwig extends \Twig_Extension
|
||||
->localize($translatableStrings);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the name of the extension.
|
||||
*
|
||||
* @return The name of the extension.
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'chill_main_localize';
|
||||
|
Reference in New Issue
Block a user