<?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>Agence de Développement Informatique du Nord &#187; print_r</title>
	<atom:link href="http://blog.adin.pro/tag/print_r/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.adin.pro</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Thu, 26 Dec 2019 08:54:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>Symfony 1.4 display an array in templates</title>
		<link>http://blog.adin.pro/2012-12-03/symfony-1-4-display-an-array-in-templates/</link>
		<comments>http://blog.adin.pro/2012-12-03/symfony-1-4-display-an-array-in-templates/#comments</comments>
		<pubDate>Mon, 03 Dec 2012 08:27:57 +0000</pubDate>
		<dc:creator><![CDATA[blogadmin]]></dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[print_r]]></category>

		<guid isPermaLink="false">http://blog.adin.pro/?p=48</guid>
		<description><![CDATA[<p>You need to use an array in your template but this array is transform as an object by symfony. in your actions/actions.class.php in your template template/choixSuccess.php This is what you get : sfOutputEscaperArrayDecorator Object ( [count:sfOutputEscaperArrayDecorator:private] => 7 [value:protected] => &#8230; <a href="http://blog.adin.pro/2012-12-03/symfony-1-4-display-an-array-in-templates/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="http://blog.adin.pro/2012-12-03/symfony-1-4-display-an-array-in-templates/">Symfony 1.4 display an array in templates</a> appeared first on <a rel="nofollow" href="http://blog.adin.pro">Agence de Développement Informatique du Nord</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>You need to use an array in your template but this array is transform as an object by symfony.</p>
<p>in your actions/actions.class.php</p>
<pre class="brush: php; title: ; notranslate">
public function executeChoix(sfWebRequest $request)
{
        $this-&gt;nom_jour = array('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi' , 'Samedi');
}
</pre>
<p>in your template template/choixSuccess.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php print_r($nom_jour); ?&gt;
</pre>
<p>This is what you get :<br />
sfOutputEscaperArrayDecorator Object ( [count:sfOutputEscaperArrayDecorator:private] => 7 [value:protected] => Array ( [0] => Dimanche [1] => Lundi [2] => Mardi [3] => Mercredi [4] => Jeudi [5] => Vendredi [6] => Samedi ) [escapingMethod:protected] => esc_specialchars ) </p>
<p>To display a proper array, use</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php print_r($sf_data-&gt;getRaw('nom_jour')); ?&gt;
</pre>
<p>You get the classic print_r render :<br />
Array ( [0] => Dimanche [1] => Lundi [2] => Mardi [3] => Mercredi [4] => Jeudi [5] => Vendredi [6] => Samedi )</p>
<p>The post <a rel="nofollow" href="http://blog.adin.pro/2012-12-03/symfony-1-4-display-an-array-in-templates/">Symfony 1.4 display an array in templates</a> appeared first on <a rel="nofollow" href="http://blog.adin.pro">Agence de Développement Informatique du Nord</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adin.pro/2012-12-03/symfony-1-4-display-an-array-in-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
