<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Searbe &#187; symfony</title>
	<atom:link href="http://www.searbe.co.uk/tag/symfony/feed" rel="self" type="application/rss+xml" />
	<link>http://www.searbe.co.uk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 19 Aug 2010 12:29:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Symfony Slots</title>
		<link>http://www.searbe.co.uk/symfony-slots</link>
		<comments>http://www.searbe.co.uk/symfony-slots#comments</comments>
		<pubDate>Fri, 15 May 2009 17:55:58 +0000</pubDate>
		<dc:creator>searbe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.searbe.co.uk/?p=56</guid>
		<description><![CDATA[How to use Slots in Symfony.
Symfony Slots are ways to set simple data in one template, and have it displayed in another. It&#8217;s helpful if, for example, you want to set the Title in the layout from a controller actions view. Rather than ramble on about Symfony Slots, I&#8217;ll blast through how Slots are used [...]]]></description>
			<content:encoded><![CDATA[<p>How to use <strong>Slots</strong> in <strong>Symfony</strong>.</p>
<p>Symfony Slots are ways to set simple data in one template, and have it displayed in another. It&#8217;s helpful if, for example, you want to set the Title in the layout from a controller actions view. Rather than ramble on about Symfony Slots, I&#8217;ll blast through how Slots are used in Symfony and leave you to figure the rest out:</p>
<p>First, this is how to retrieve a slot you have set (I will go over setting them in a moment):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$x</span> <span style="color: #339933;">=</span> get_slot<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'slot_name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #990000;">echo</span> <span style="color: #000088;">$x</span><span style="color: #339933;">;</span></pre></div></div>

<p>Or you can just output the slot:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">include_slot<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'slot_name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Thats useful, for example, in your global template (layout).</p>
<p>You might want to set the slot &#8211; useful in a page-specific view, for example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">slot<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'The title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Or you can do it like this, so you don&#8217;t have to explain to Mr. front-end developer why a single quote is breaking everything:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> slot<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'extra'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;meta foobarfoo /&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> end_slot<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Finally, you might want to check if a slot exists:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>has_slot<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'extra'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
  include_slot<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'extra'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span></pre></div></div>

<p>So there you go. Bish, bash, bosh.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.searbe.co.uk/symfony-slots/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony Admin Generator File Upload</title>
		<link>http://www.searbe.co.uk/symfony-admin-generator-file-upload</link>
		<comments>http://www.searbe.co.uk/symfony-admin-generator-file-upload#comments</comments>
		<pubDate>Thu, 09 Apr 2009 21:24:08 +0000</pubDate>
		<dc:creator>searbe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.searbe.co.uk/?p=41</guid>
		<description><![CDATA[This post is presuming that you &#8230;

have Symfony 1.2+
have models set up
have some sort of admin area set up, albeit without file uploads

This is *not* about storing file data in the database, it is about storing file *locations* in the database. The actual file data will be stored on the filesystem.
So lets get file uploads [...]]]></description>
			<content:encoded><![CDATA[<p>This post is presuming that you &#8230;</p>
<ul>
<li>have Symfony 1.2+</li>
<li>have models set up</li>
<li>have some sort of admin area set up, albeit without file uploads</li>
</ul>
<p>This is *not* about storing file data in the database, it is about storing file *locations* in the database. The actual file data will be stored on the filesystem.</p>
<p>So lets get file uploads set up. Firstly, go into the form class for the model which you want to accept file uploads (you know, /lib/<strong>form</strong>/doctrine/YourModelForm.class.php).</p>
<p>You need to configure a <strong>widget</strong> and a <strong>validator</strong>. In case you&#8217;re not already familiar, the widget is (sort-of) the input type (textarea, drop-down box, etc) and the validator is the thing that says &#8220;Yes, this input is valid&#8221; or &#8220;No, this input is bad&#8221;. You choose various widgets and various validators, each having their own subset of options.</p>
<p>In the Form class, add a configure function. Make sure it calls the parent configure function so all the base config happens!</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> MyForm <span style="color: #000000; font-weight: bold;">extends</span> BaseMyForm
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> configure<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    parent<span style="color: #339933;">::</span><span style="color: #004000;">configure</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now, add a widget to your field. Note that where it says &#8220;the_image_url&#8221;, that&#8217;s simply what I&#8217;ve called the column in my schema. You might have called your column &#8220;image&#8221; or &#8220;file&#8221; or something &#8211; so update it as necesarry.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> MyForm <span style="color: #000000; font-weight: bold;">extends</span> BaseMyForm
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> configure<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    parent<span style="color: #339933;">::</span><span style="color: #004000;">configure</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'the_image_url'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormInputFileEditable<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
      <span style="color: #0000ff;">'label'</span>     <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'The Image'</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'file_src'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/uploads/images/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTheImageUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'is_image'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'edit_mode'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isNew</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'template'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'
&lt;div&gt;%file%%input%%delete% %delete_label%&lt;/div&gt;
'</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Nearly done &#8211; add a validator. In my case I will only allow images, so I set &#8216;web_images&#8217; as the mime_types option:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> MyForm <span style="color: #000000; font-weight: bold;">extends</span> BaseMyForm
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> configure<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    parent<span style="color: #339933;">::</span><span style="color: #004000;">configure</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'the_image_url'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormInputFileEditable<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
      <span style="color: #0000ff;">'label'</span>     <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'The Image'</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'file_src'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/uploads/images/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTheImageUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'is_image'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'edit_mode'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isNew</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'template'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'
&lt;div&gt;%file%%input%%delete% %delete_label%&lt;/div&gt;
'</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validatorSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'the_image_url'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfValidatorFile<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
      <span style="color: #0000ff;">'required'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'path'</span>       <span style="color: #339933;">=&gt;</span> sfConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sf_upload_dir'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/images'</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'mime_types'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'web_images'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And finally, add a &#8216;delete&#8217; button so you can delete the image (optional, but if you don&#8217;t do this, you should probably remove the %delete% stuff from the template section of the file field&#8217;s widget!)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> MyForm <span style="color: #000000; font-weight: bold;">extends</span> BaseMyForm
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> configure<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    parent<span style="color: #339933;">::</span><span style="color: #004000;">configure</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">widgetSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'the_image_url'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfWidgetFormInputFileEditable<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
      <span style="color: #0000ff;">'label'</span>     <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'The Image'</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'file_src'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/uploads/images/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTheImageUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'is_image'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'edit_mode'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isNew</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'template'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'
&lt;div&gt;%file%%input%%delete% %delete_label%&lt;/div&gt;
'</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validatorSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'the_image_url'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfValidatorFile<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
      <span style="color: #0000ff;">'required'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'path'</span>       <span style="color: #339933;">=&gt;</span> sfConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sf_upload_dir'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/images'</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'mime_types'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'web_images'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">validatorSchema</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'feature_image_url_delete'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfValidatorPass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Then go for a &#8220;symfony cc&#8221;, generate your admin area if you haven&#8217;t already, and enjoy your lovely file uploads <img src='http://www.searbe.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Hope that helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.searbe.co.uk/symfony-admin-generator-file-upload/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Symfony Get Raw Data from Function in Template</title>
		<link>http://www.searbe.co.uk/symfony-get-raw-data-from-function-in-template</link>
		<comments>http://www.searbe.co.uk/symfony-get-raw-data-from-function-in-template#comments</comments>
		<pubDate>Sun, 01 Mar 2009 23:38:20 +0000</pubDate>
		<dc:creator>searbe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.searbe.co.uk/?p=27</guid>
		<description><![CDATA[If you&#8217;re in a template in Symfony, and you have your output escaping enabled, one thing that bugged me was when I tried to do this:

$my_model-&#62;getMyOutput&#40;'param1','param2'&#41;;

The output would be escaped &#8211; for example I&#8217;d get &#8220;&#60;b&#62;this is bold&#60;/b&#62;&#8221; rather than &#8220;this is bold&#8220;. The usual $my_model-&#62;getRaw(&#8217;MyOutput&#8217;) didn&#8217;t help, as it doesn&#8217;t accept parameters (actually I [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re in a template in Symfony, and you have your output escaping enabled, one thing that bugged me was when I tried to do this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$my_model</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMyOutput</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'param1'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'param2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The output would be escaped &#8211; for example I&#8217;d get &#8220;&lt;b&gt;this is bold&lt;/b&gt;&#8221; rather than &#8220;<strong>this is bold</strong>&#8220;. The usual $my_model-&gt;getRaw(&#8217;MyOutput&#8217;) didn&#8217;t help, as it doesn&#8217;t accept parameters (actually I expected it to take an optional second parameter, being an array of parameters, and was quite suprised to find that wasn&#8217;t the case).</p>
<p><em>A quick note &#8211; incase you weren&#8217;t already aware &#8211; calling $model-&gt;getRaw(&#8217;Column&#8217;); will get the unescaped version of $model-&gt;getColumn;</em></p>
<p>The solution is there, sitting happily in the documentation. But I want to give you a Google insta-answer. What you need to do is put ESC_RAW as the last parameter:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$my_model</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMyOutput</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'param1'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'param2'</span><span style="color: #339933;">,</span>ESC_RAW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Then your template gets the raw output of the function you&#8217;re calling, rather than automagically escaping the data for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.searbe.co.uk/symfony-get-raw-data-from-function-in-template/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
