Skip to content

Instantly share code, notes, and snippets.

@sglessard
Forked from melz/sf14_get_raw_value
Created October 17, 2023 16:12
Show Gist options
  • Select an option

  • Save sglessard/8b4eb4bddcd9983a1bd315b93df92c1e to your computer and use it in GitHub Desktop.

Select an option

Save sglessard/8b4eb4bddcd9983a1bd315b93df92c1e to your computer and use it in GitHub Desktop.
Obtain the raw value from an sfOutputEscaperArrayDecorator object
<?php
// 1) Escaping on; View template
$manufacturers = $sf_user->getAttribute('manufacturer_ids', array(), 'mdUser');
$user_manufacturers->getRawValue(); // returns an array()
// for variables in view template
echo $sf_data->getRaw('variable_name');
// disable escaping from class method output
echo $object->getSomething(ESC_RAW);
// 2) Escaping on; Turn off in actions
sfConfig::set('sf_escaping_strategy', false);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment