Symfony Is it possible to disable output shielding for each module (or for each template)?

I'm trying to output some HTML into an XML template, and the symfony escaping method messed it up. So I tried to make a copy of settings.yml in the module configuration folder, but it seems to be completely ignored. Is there an easy way to change the escaping_strategy and / or escaping_method parameters for each module or even for each template?

+7
php symfony1
source share
3 answers

While output escaping is enabled, you still have access to the raw value via $sf_data . For example, if the HTML you are trying to output was stored in the html variable in your action:

 $this->html = '<b>My HTML</b>'; 

You can get an unexpressed value with this:

 <?php echo $sf_data->getRaw('html') ?> 

http://www.symfony-project.org/book/1_0/07-Inside-the-View-Layer#chapter_07_sub_activating_output_escaping

I do not believe that there is a way to disable this functionality for each module.

+17
source share

getRaw only works if the variable is passed from the action. for variable inside view use

 sfOutputEscaperGetterDecorator::unescape($html) 
+10
source share

Just run this problem today, and I was able to solve it by setting sfConfig::set('sf_escaping_strategy', false) in my controller (either in the preExecute method for all actions in this module, or in the specific action - executeWhatever ).

+9
source share

All Articles