I know it must use htmlspecialchars() but it automatic clean the output when I use echo statement. Manually, without symfony, how can I do that? Override echo statement? I know theres ob_start(), ob_get_contents() etc, but it then clean the 开发者_如何学JAVAwhole output
There's a method for outputting data in the template that bypasses the output escaping:
<?php echo $sf_data->getRaw('variable_name_here'); ?>
I think you can even output the entire template content for specific layouts using:
<?php echo $sf_data->getRaw('sf_content') ?>
The escaping settings for your app are controlled in settings.yml (all_settings_escaping_method). You should see ESC_SPECIALCHARS on by default.
Also, using...
<?php echo html_entity_decode($variable) ?>
... can help sometimes.
精彩评论