symfony - clean variables before sending to template

mashadow

New Member
On the project I am currently working, I had created an action that generates a csv file.Here is some of my current template codem, which generated the csv file on-the-fly:\[code\]<?php header('Content-Disposition: attachment; filename="file_'.date("Y-m-d_H-i",time()) .'.csv"'); ?>Branch:;<?php echo $branch; ?>;\[/code\]The variable $branch, needs some formatting to be displayed on the csv file. For now, all the cleaning/formatting work is being done on the action itself but I do know it is not the most adequate place. Should I create a private auxiliary function on the file that contains the action or it is recommended a more suitable place?Note that I would like to avoid to perform the cleaning/formatting work on the template because some is quite extensive.Thanks in advance for the help,Best regards!
 
Back
Top