<?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>Symfony-IT &#187; programmazione</title>
	<atom:link href="http://www.symfony.it/categoria/programmazione/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.symfony.it</link>
	<description>Just another Symfony Framework weblog</description>
	<lastBuildDate>Mon, 30 Jan 2012 13:53:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<div id='fb-root'></div>
					<script type='text/javascript'>
						window.fbAsyncInit = function()
						{
							FB.init({appId: null, status: true, cookie: true, xfbml: true});
						};
						(function()
						{
							var e = document.createElement('script'); e.async = true;
							e.src = document.location.protocol + '//connect.facebook.net/it_IT/all.js';
							document.getElementById('fb-root').appendChild(e);
						}());
					</script>	
						<item>
		<title>&#8220;Di più con symfony&#8221; su Amazon come presente per l&#8217;anno nuovo!</title>
		<link>http://www.symfony.it/articoli/231/di-piu-con-symfony-su-amazon-come-presente-per-lanno-nuovo/</link>
		<comments>http://www.symfony.it/articoli/231/di-piu-con-symfony-su-amazon-come-presente-per-lanno-nuovo/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 15:03:12 +0000</pubDate>
		<dc:creator>fullo</dc:creator>
				<category><![CDATA[doctrine]]></category>
		<category><![CDATA[libri]]></category>
		<category><![CDATA[programmazione]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[di più con symfony]]></category>
		<category><![CDATA[documentazione]]></category>
		<category><![CDATA[more with symfony]]></category>

		<guid isPermaLink="false">http://www.symfony.it/?p=231</guid>
		<description><![CDATA[È ufficialmente disponibile su Amazon, la nuova traduzione italiana dell&#8217;advent calendar intitolato More with Symfony e rilasciato agli inizi di dicembre in formato digitale in più lingue e cartaceo nella sola lingua inglese. Il libro approfondisce argomenti come il routing, la nuova gestione delle email di symfony 1.4, gli internals di symfony e come estendere [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/2918390216?ie=UTF8&#038;tag=fullo-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=2918390216"><img src="http://www.symfony.it/wp-content/uploads/2009/12/51hN+Ml-NmL._SL160_.jpg" alt="Di più con symfony, il libro" title="51hN+Ml-NmL._SL160_" width="124" height="160" class="alignleft size-full wp-image-233" /></a><img src="http://www.assoc-amazon.com/e/ir?t=fullo-20&#038;l=as2&#038;o=1&#038;a=2918390216" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" align="left" /> È ufficialmente disponibile su Amazon, la nuova <a href="http://www.amazon.com/gp/product/2918390216?ie=UTF8&#038;tag=fullo-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=2918390216">traduzione italiana</a> dell&#8217;<a href="http://www.symfony-project.org/advent_calendar/">advent calendar</a> intitolato <em>More with Symfony</em> e rilasciato agli inizi di dicembre in formato digitale in più lingue e <a href="http://www.amazon.com/gp/product/2918390178?ie=UTF8&#038;tag=fullo-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=2918390178">cartaceo nella sola lingua inglese</a><img src="http://www.assoc-amazon.com/e/ir?t=fullo-20&#038;l=as2&#038;o=1&#038;a=2918390178" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />. </p>
<p>Il libro approfondisce argomenti come il <a href="http://www.symfony-project.org/advent_calendar/2/it">routing</a>, la nuova<a href="http://www.symfony-project.org/advent_calendar/5/it"> gestione delle email di symfony 1.4</a>, gli <a href="http://www.symfony-project.org/advent_calendar/16/it">internals di symfony</a> e come <a href="http://www.symfony-project.org/advent_calendar/11/it">estendere</a> <a href="http://www.symfony-project.org/advent_calendar/14/it">Doctrine</a>.</p>
<p>Il libro è stato tradotto dalla <a href="http://groups.google.com/group/symfony-it">comunità italiana di Symfonisti</a> che si è prodigata per renderlo disponibile immediatamente insieme alla versione ufficiale.</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://www.symfony.it/articoli/231/di-piu-con-symfony-su-amazon-come-presente-per-lanno-nuovo/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.symfony.it/articoli/231/di-piu-con-symfony-su-amazon-come-presente-per-lanno-nuovo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Usando symfony 1.2 e Doctrine 1.0 problemi con le equal nested relation</title>
		<link>http://www.symfony.it/articoli/149/usando-symfony-12-e-doctrine-10-problemi-con-le-equal-nested-relation/</link>
		<comments>http://www.symfony.it/articoli/149/usando-symfony-12-e-doctrine-10-problemi-con-le-equal-nested-relation/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 20:55:13 +0000</pubDate>
		<dc:creator>filippo</dc:creator>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[symfony1.2]]></category>

		<guid isPermaLink="false">http://www.symfony.it/?p=149</guid>
		<description><![CDATA[Non so se vi è mai capitato di avere a che fare con le cosiddette &#8220;equal nested relation&#8221;. Queste relazioni tra oggetti sono quelle relazioni che possono essere tradotte (per quanto riguarda il database) con un &#8220;auto join&#8221; su una stessa tabella. Un esempio pratico lo potete trovare fra gli esempi del sito dell&#8217;ORM Doctrine [...]]]></description>
			<content:encoded><![CDATA[<p>Non so se vi è mai capitato di avere a che fare con le cosiddette &#8220;equal nested relation&#8221;. Queste relazioni tra oggetti sono quelle relazioni che possono essere tradotte (per quanto riguarda il database) con un &#8220;auto join&#8221; su una stessa tabella.</p>
<p>Un esempio pratico lo potete trovare fra gli esempi del sito dell&#8217;ORM Doctrine : <a href="http://www.doctrine-project.org/documentation/manual/1_1/en/defining-models:relationships:join-table-associations:self-referencing-nest-relations:equal-nest-relations">Equal Nested Relation</a>.</p>
<p>In uno dei miei progetti (Symfony 1.2, Doctrine 1.0) ho dovuto usare un esempio analogo, ma invece che utenti collegati fra loro con una relazione molti a molti, dovevo collegare più ticket. Una volta messo tutto in piedi e creato le classi necessarie ho fatto qualche prova e mi è spuntato questo errore: </p>
<pre>
500 | Internal Server Error
Doctrine_Connection_Mysql_Exception SQLSTATE23000: Integrity constraint violation: 1062 Duplicate entry 'N-N' for key 1
</pre>
<p>Inizialmente ho cercato una soluzione che potesse dipendere dalle configurazioni del file schema.yml che usavo e poi soluzioni che potessero riguardare qualsiasi altra cosa. Dopo quasi due giorni a sbattere la testa su questo problema sono andato al PHPDay2009 a cui avrebbe partecipato anche <a href="http://www.jwage.com/">Jonathan Wage</a>, ovviamente ripromettendomi di chiedere direttamente a lui!!</p>
<p>Fortunatamente c&#8217;è stata occasione di parlargli e Jonathan è stato più che gentile tanto da aiutarmi e mettersi a provare a trovare una soluzione lì per lì per il mio problema. Dopo circa un&#8217;ora siamo arrivati a capire dov&#8217;era il problema. Poi a pezzi e bocconi siamo arrivati ad una soluzione nelle successive 24 ore!</p>
<p>La patch da utilizzare è scaricabile da <a href="http://www.php-collab.org/patch.diff">qui</a>. Ricordo che questa <strong>NON È UNA SOLUZIONE DEFINITIVA</strong>. <strong>E&#8217; piuttosto un workaround al problema!!</strong> Un ticket relativo a questa soluzione è stato aperto <a href="http://trac.doctrine-project.org/ticket/2151">qui</a>.</p>
<p>Sembra che questo problema sia risolto utilizzando symfony 1.3 e doctrine 1.1, quindi aspettiamo con ansia la prossima uscita di symfony che include sfDoctinePlugin con doctrine 1.1!</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://www.symfony.it/articoli/149/usando-symfony-12-e-doctrine-10-problemi-con-le-equal-nested-relation/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.symfony.it/articoli/149/usando-symfony-12-e-doctrine-10-problemi-con-le-equal-nested-relation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Symfony, Doctrine e validatori</title>
		<link>http://www.symfony.it/articoli/137/symfony-doctrine-e-validatori/</link>
		<comments>http://www.symfony.it/articoli/137/symfony-doctrine-e-validatori/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 09:30:42 +0000</pubDate>
		<dc:creator>filippo</dc:creator>
				<category><![CDATA[doctrine]]></category>
		<category><![CDATA[programmazione]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.symfony.it/?p=137</guid>
		<description><![CDATA[Ultimamente mi è capitato di lavorare con Doctrine all&#8217;interno di un progetto symfony e di dover validare dei campi in input rispetto ad una classe del mio modello. Per particolari accorgimenti nella selezione degli input accettati mi sono trovato di fronte ad un problema che mi ha fatto perdere un po&#8217; di tempo e che [...]]]></description>
			<content:encoded><![CDATA[<p>Ultimamente mi è capitato di lavorare con Doctrine all&#8217;interno di un progetto symfony e di dover validare dei campi in input rispetto ad una classe del mio modello. Per particolari accorgimenti nella selezione degli input accettati mi sono trovato di fronte ad un problema che mi ha fatto perdere un po&#8217; di tempo e che non sono riuscito a capire subito da cosa dipendesse. Lo segno qui per chi si trovasse nella mia stessa situazione.</p>
<p>Per la validazione degli input ho utilizzato <a title="sfValidatorDoctrineChoiceMany" href="http://www.symfony-project.org/api/1_2/sfValidatorDoctrineChoiceMany">sfValidatorDoctrineChoiceMany</a>, che già valida gli input rispetto ad una classe del modello</p>
<p><code>$this->validatorSchema['users_list'] = new sfValidatorDoctrineChoiceMany(array('model' => 'User');</code></p>
<p>La particolarità a cui mi sono trovato di fronte è quella in cui i valori accettati in input dovevano essere validati rispetto ad un sottoinsieme di quelli contenuti nel mio modello. Seguendo <a title="guida validatori symfony" href="http://www.symfony-project.org/forms/1_2/en/A-Widgets#chapter_a_sub_choice-bound-to-a-doctrine-model">la guida</a> trovata sul sito di symfony aggiungo il parametro &#8216;query&#8217; al mio validatore.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$q</span> <span style="color: #339933;">=</span> Doctrine_Query<span style="color: #339933;">::</span><span style="color: #004000;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">from</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'User u'</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">where</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'u.name = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<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;">'users_list'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfValidatorDoctrineChoiceMany<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'model'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'User'</span> <span style="color: #339933;">,</span><span style="color: #0000ff;">'query'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$q</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>A questo punto però mi sono trovato di fronte all&#8217;errore</p>
<p><code>500 | Internal Server Error | Doctrine_Exception</p>
<p>Couldn't find class a</code></p>
<p>Non avendo nessuna classe (né alias) &#8216;a&#8217; definita nel modello mi sono girato un po&#8217; i log che vengono forniti da symfony e ho scoperto che sfValidatorDoctrineChoiceMany, durante il cleaning dei valori in input, esegue la query aggiungendo un&#8217;opzione al &#8216;where&#8217;:</p>
<p><em>sfValidatorDoctrineChoiceMany.class.php</em></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">...</span>
<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'alias'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$q</span> <span style="color: #339933;">=</span> <span style="color: #990000;">is_null</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? Doctrine_Query<span style="color: #339933;">::</span><span style="color: #004000;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">from</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'model'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$a</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'query'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$q</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$q</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">andWhereIn</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getColumn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$values</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$objects</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$q</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">...</span></pre></td></tr></table></div>

<p>Questo comportamento è giusto per il classico meccanismo di Doctrine di inserire un alias quando si esegue una query del tipo</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">status_list</span> <span style="color: #339933;">=</span> Doctrine<span style="color: #339933;">::</span><span style="color: #004000;">getTable</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'User'</span><span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">-&gt;</span><span style="color: #004000;">createQuery</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'a'</span><span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">-&gt;</span><span style="color: #004000;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>ma non lo è quando si genera una query leggermente più complessa.</p>
<p>La soluzione di questo problema è molto semplice ma non così banale, almeno dal mio punto di vista. Basta infatti aggiungere al validatore l&#8217;opzione &#8216;alias&#8217;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><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;">'users_list'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> sfValidatorDoctrineChoiceMany<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'model'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'User'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'alias'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">,</span><span style="color: #0000ff;">'query'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$q</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Spero che questo appunto possa darvi una mano se mai vi troverete di fronte alla mia stessa situazione.</p>
<p>Buono &#8220;sviluppo&#8221; a tutti!</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://www.symfony.it/articoli/137/symfony-doctrine-e-validatori/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.symfony.it/articoli/137/symfony-doctrine-e-validatori/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>phpEdit, anche Windows ha il suo IDE per Symfony</title>
		<link>http://www.symfony.it/articoli/133/phpedit-anche-windows-ha-il-suo-ide-per-symfony/</link>
		<comments>http://www.symfony.it/articoli/133/phpedit-anche-windows-ha-il-suo-ide-per-symfony/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 13:46:33 +0000</pubDate>
		<dc:creator>fullo</dc:creator>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programmazione]]></category>
		<category><![CDATA[phpedit]]></category>
		<category><![CDATA[waterproof]]></category>

		<guid isPermaLink="false">http://www.symfony.it/?p=133</guid>
		<description><![CDATA[Waterproof, azienda francese che sviluppa l&#8217;ottimo IDE per windows phpEdit, ha annunciato il supporto per Symfony all&#8217;interno del proprio IDE. Come potete vedere dallo screencast qui sotto le features sono tante ed interessanti e non si concentrano solo al supporto dei task (presenti anche in altri IDE) ma vanno a fondo con shortcut per la [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.waterproof.fr">Waterproof</a>, azienda francese che sviluppa l&#8217;ottimo IDE per windows phpEdit, ha <a href="http://www.phpedit.com/News/PHPEdit-3.2-is-available!">annunciato il supporto per Symfony</a> all&#8217;interno del proprio IDE. </p>
<p>Come potete vedere dallo <a href="http://www.waterproof.fr/~shordeaux/phpedit-3.2/screencast/en/">screencast</a> qui sotto le features sono tante ed interessanti e non si concentrano solo al supporto dei task (presenti anche in altri IDE) ma vanno a fondo con shortcut per la gestione dell&#8217;interno pattern MVC. </p>
<div id="media">            <object id="csSWF" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="256" height="146" codebase="http://active.macromedia.com/flash7/cabs/ swflash.cab#version=9,0,28,0"><param name="src" value="http://www.waterproof.fr/~shordeaux/phpedit-3.2/screencast/en/sf_en_swf.swf"/><param name="bgcolor" value="#1a1a1a"/><param name="quality" value="best"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><param name="scale" value="showall"/><param name="flashVars" value="autostart=false"/><embed name="csSWF" src="http://www.waterproof.fr/~shordeaux/phpedit-3.2/screencast/en/sf_en_swf.swf" width="256" height="146" bgcolor="#1a1a1a" quality="best" allowScriptAccess="always" allowFullScreen="true" scale="showall" flashVars="autostart=false" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object>        </div>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://www.symfony.it/articoli/133/phpedit-anche-windows-ha-il-suo-ide-per-symfony/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.symfony.it/articoli/133/phpedit-anche-windows-ha-il-suo-ide-per-symfony/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sun annuncia il supporto a Symfony in NetBeans 7</title>
		<link>http://www.symfony.it/articoli/99/sun-annuncia-il-supporto-a-symfony-in-netbeans-7/</link>
		<comments>http://www.symfony.it/articoli/99/sun-annuncia-il-supporto-a-symfony-in-netbeans-7/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 23:30:07 +0000</pubDate>
		<dc:creator>fullo</dc:creator>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[programmazione]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[varie]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://www.symfony.it/?p=99</guid>
		<description><![CDATA[Con un breve comunicato, fatto direttamente all&#8217;interno dell&#8217;Issue Tracking di NetBeans, Sun ha annunciato che sono già iniziati i lavori per supportare ufficialmente Symfony nella versione 7.0 dell&#8217;IDE. Ecco il testo del messaggio: The news is that the Symfony support will be part of NetBeans 7.0. We are going to start work on it very [...]]]></description>
			<content:encoded><![CDATA[<p>Con un breve comunicato, fatto direttamente all&#8217;<a href="http://www.netbeans.org/issues/show_bug.cgi?id=145913">interno dell&#8217;Issue Tracking</a> di <a href="http://www.netbeans.org/">NetBeans</a>, Sun ha annunciato che sono già iniziati i lavori per supportare ufficialmente <a href="http://www.symfony-project.org">Symfony</a> nella versione 7.0 dell&#8217;IDE.</p>
<p>Ecco il testo del messaggio:</p>
<blockquote><p><strong>The news is that the Symfony support will be part of NetBeans 7.0</strong>. We are going to start work on it very soon. I hope that it will be a part of continual build this year and community can comment the support and work with us to finish it in the best possible quality and usability.</p></blockquote>
<p>NetBeans, che dalla versione 6.5, permette di gestire progetti sviluppati con PHP 5 sta diventanto un nuovo punto di riferimento per tutti quegli sviluppatori che non hanno apprezzato la scelta &#8220;Eclipse&#8221; fatta da Zend come motore dello Zend Studio.</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://www.symfony.it/articoli/99/sun-annuncia-il-supporto-a-symfony-in-netbeans-7/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.symfony.it/articoli/99/sun-annuncia-il-supporto-a-symfony-in-netbeans-7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Come utilizzare punti nelle URL</title>
		<link>http://www.symfony.it/articoli/21/come-utilizzare-punti-nelle-url/</link>
		<comments>http://www.symfony.it/articoli/21/come-utilizzare-punti-nelle-url/#comments</comments>
		<pubDate>Fri, 28 Sep 2007 16:17:10 +0000</pubDate>
		<dc:creator>Manuel `EndelWar` Dalla Lana</dc:creator>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.symfony.it/articoli/21/come-utilizzare-punti-nelle-url/</guid>
		<description><![CDATA[Quando in un progetto si utilizzano url contenenti punti, in una installazione standard di symfony, si otterrà dal server web un errore 404: questo perché verrà cercato dal server stesso un file piuttosto che ridirigere la richiesta al motore di routing di symfony. Facciamo un esempio pratico: routing.yml: test: url: /test/:title param: { module: test, [...]]]></description>
			<content:encoded><![CDATA[<p>Quando in un progetto si utilizzano url contenenti punti, in una installazione standard di symfony, si otterrà dal server web un errore 404: questo perché verrà cercato dal server stesso un file piuttosto che ridirigere la richiesta al motore di routing di symfony.<br />
Facciamo un esempio pratico:<br />
<code>routing.yml:<br />
test:<br />
  url:   /test/:title<br />
  param: { module: test, action: index }</p>
<p>/modules/test/templates/indexSuccess.php:<br />
&lt;?php echo $sf_params-&gt;get('title'); ?&gt;<br />
</code></p>
<p>Ora se visitiamo la seguente url http://localhost/test/abc apparirà a video la scritta abc.<br />
Se invece utilizziamo quest&#8217;altra url http://localhost/test/a.b.c il risultato sarà un errore 4040 &#8220;The requested URL /test/a.bc was not found on this server.&#8221;.</p>
<p>Per evitare questo comportamento si deve mettere mano al file .htaccess presente nella directory web del nostro progetto per un veloce hack, commentando la prima regola di rewriting in questo modo:<br />
<code><br />
# we skip all files with .something<br />
  #RewriteCond %{REQUEST_URI} \..+$<br />
  #RewriteCond %{REQUEST_URI} !\.html$<br />
  #RewriteRule .* - [L]<br />
</code></p>
<p>In questa maniera ricaricando l&#8217;url http://localhost/test/a.b.c si otterrà nel browser il risultato voluto, cioè la stringa &#8220;a.b.c&#8221;</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://www.symfony.it/articoli/21/come-utilizzare-punti-nelle-url/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.symfony.it/articoli/21/come-utilizzare-punti-nelle-url/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript &amp; Ajax? eval()!</title>
		<link>http://www.symfony.it/articoli/14/javascript-ajax-eval/</link>
		<comments>http://www.symfony.it/articoli/14/javascript-ajax-eval/#comments</comments>
		<pubDate>Fri, 10 Aug 2007 09:13:52 +0000</pubDate>
		<dc:creator>giorg</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.symfony.it/articoli/14/javascript-ajax-eval/</guid>
		<description><![CDATA[Oggi dovevo eseguire del codice Javascript nel risultato di una chiamata ajax. Il template è fatto circa così: 1 2 3 4 5 6 &#60;?php echo __&#40;'Aggiungi prodotto'&#41; ?&#62;&#60;input type=&#34;button&#34; value=&#34;+&#34; onclick=&#34;addprod()&#34; /&#62; &#60;?php echo javascript_tag&#40;&#34; function addprod() { alert('ciao') } &#34;&#41; ?&#62; Se chiamato &#8220;direttamente&#8221;, questo template funziona e visualizzerà correttamente l&#8217;alert. Ciò non [...]]]></description>
			<content:encoded><![CDATA[<p>Oggi dovevo eseguire del codice Javascript nel risultato di una chiamata ajax. Il template è fatto circa così:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Aggiungi prodotto'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;input type=&quot;button&quot; value=&quot;+&quot; onclick=&quot;addprod()&quot; /&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> javascript_tag<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;
  function addprod() { 
    alert('ciao')
  }
&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Se chiamato &#8220;direttamente&#8221;, questo template funziona e visualizzerà correttamente l&#8217;alert. Ciò non si verificherà invece se il template in questione è il risultato di una chiamata Ajax. Come <a href="http://www.sergiopereira.com/articles/prototype.js.html#UsingAjaxUpdater">spiega il buon Sergio Pereira</a>, ciò dipende dal fatto che il codice Javascript nel risultato di una chiamata ajax viene <strong>valutato</strong> (tramite la funzione eval()) per cui il template deve essere riscritto nel seguente modo:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Aggiungi prodotto'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;input type=&quot;button&quot; value=&quot;+&quot; onclick=&quot;addprod()&quot; /&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> javascript_tag<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;
  addprod = function() { 
    alert('alora')
  }
&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>in modo che la funzione venga <em>creata</em>.</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://www.symfony.it/articoli/14/javascript-ajax-eval/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.symfony.it/articoli/14/javascript-ajax-eval/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Calendario nel risultato di una chiamata Ajax</title>
		<link>http://www.symfony.it/articoli/11/calendario-nel-risultato-di-una-chiamata-ajax/</link>
		<comments>http://www.symfony.it/articoli/11/calendario-nel-risultato-di-una-chiamata-ajax/#comments</comments>
		<pubDate>Mon, 06 Aug 2007 14:11:45 +0000</pubDate>
		<dc:creator>giorg</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.symfony.it/articoli/11/calendario-nel-risultato-di-una-chiamata-ajax/</guid>
		<description><![CDATA[Oggi dovevo utilizzare l&#8217;helper input_date_tag all&#8217;interno di un template che di fatto era il risultato di una chiamata Ajax. Dato che normalmente non ho mai avuto problemi con quell&#8217;helper mi è risultato strano l&#8217;errore Javascript &#8220;Calendar is not defined&#8221;; dopo un attimo di ricerca ho capito che in tale frangente i Javascript e i css [...]]]></description>
			<content:encoded><![CDATA[<p>Oggi dovevo utilizzare l&#8217;helper <a href="http://www.symfony-project.com/api/symfony/helper/FormHelper.html">input_date_tag</a> all&#8217;interno di un template che di fatto era il risultato di una chiamata Ajax.<br />
Dato che normalmente non ho mai avuto problemi con quell&#8217;helper mi è risultato strano l&#8217;errore Javascript &#8220;Calendar is not defined&#8221;; dopo un attimo di ricerca ho capito che in tale frangente i Javascript e i css non vengono inclusi automaticamente (come invece avviene di solito), per cui ho dovuto aggiungerli nel file di configurazione del modulo view.yml:</p>
<pre>
  stylesheets:    [/sf/calendar/skins/aqua/theme.css]
  javascripts:    [/sf/calendar/calendar.js, /sf/calendar/lang/calendar-it.js, /sf/calendar/calendar-setup.js]
</pre>
<p>et voilà, il calendario funziona di nuovo.</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://www.symfony.it/articoli/11/calendario-nel-risultato-di-una-chiamata-ajax/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.symfony.it/articoli/11/calendario-nel-risultato-di-una-chiamata-ajax/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Albero ajax</title>
		<link>http://www.symfony.it/articoli/9/albero-ajax/</link>
		<comments>http://www.symfony.it/articoli/9/albero-ajax/#comments</comments>
		<pubDate>Thu, 19 Jul 2007 15:56:07 +0000</pubDate>
		<dc:creator>giorg</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.symfony.it/articoli/9/albero-ajax/</guid>
		<description><![CDATA[Ho avuto il problema di creare un albero prendendo categorie e subcategorie dal database; il tutto con una certa user experience, per cui possibilmente ajax. Avevo provato il plugin sfgWidgetsPlugin ma non permette più di un innesto (manca qualcosa tipo evalScript: true nella chiamata ajax), per cui ho dovuto fare a mano. A seguito la [...]]]></description>
			<content:encoded><![CDATA[<p>Ho avuto il problema di creare un albero prendendo categorie e subcategorie dal database; il tutto con una certa user experience, per cui possibilmente ajax. Avevo provato il plugin <a href="http://trac.symfony-project.com/trac/wiki/sfgWidgetsPlugin">sfgWidgetsPlugin</a> ma non permette più di un innesto (manca qualcosa tipo evalScript: true nella chiamata ajax), per cui ho dovuto fare a mano.</p>
<p>A seguito la mia soluzione.</p>
<p><span id="more-9"></span></p>
<p>Prima di tutto nella mia action tiro fuori la prima serie di categorie:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> getCategorie<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$c</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Criteria<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAscendingOrderByColumn</span><span style="color: #009900;">&#40;</span>CategoriePeer<span style="color: #339933;">::</span><span style="color: #004000;">CATEGORIE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">categorie</span> <span style="color: #339933;">=</span> CategoriePeer<span style="color: #339933;">::</span><span style="color: #004000;">doSelect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">forward404Unless</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">categorie</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Dopodiché,  nel template, ciclo sulle tuple trovate:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$categorie</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$categoria</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;p class=&quot;categoria&quot;&gt;
&lt;p class=&quot;catname_div&quot;&gt;</pre></td></tr></table></div>

<p>Voglio mettere l&#8217;iconcina con il classico &#8220;+&#8221; nel caso ci sia almeno una sottocategoria, per cui:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$c</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Criteria<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add</span><span style="color: #009900;">&#40;</span>SottocategoriePeer<span style="color: #339933;">::</span><span style="color: #004000;">RIF_CATEGORIE</span><span style="color: #339933;">,</span> <span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> Criteria<span style="color: #339933;">::</span><span style="color: #004000;">EQUAL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$sottocat_count</span> <span style="color: #339933;">=</span> SottocategoriePeer<span style="color: #339933;">::</span><span style="color: #004000;">doCount</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$sottocat_count</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> image_tag<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'explode.gif'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'img_'</span><span style="color: #339933;">.</span><span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Ora ci occorrerebbe il famoso helper link_to_remote per poter accedere alle sub-sub-categorie; però mi piacerebbe poter clikkare sul nome di una categoria sia per espandere l&#8217;albero che per chiuderlo. Per questo motivo la chiamata ajax deve essere condizionale con un ramo else, cosa non permessa dall&#8217;helper, per cui vado a mano:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;a href=&quot;#&quot; onclick=&quot;if (document.getElementById('sottocat_<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>').innerHTML == '') {new Ajax.Updater('sottocat_<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>', 'categorie/trovasotto/id/<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>', {asynchronous:true, evalScripts:true, onComplete:function(request, json){document.getElementById('img_<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>').src='/images/implode.gif'; Element.hide('indicator');}, onLoading:function(request, json){Element.show('indicator')}}); return false;} else {document.getElementById('sottocat_<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>').innerHTML = ''; document.getElementById('img_<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>').src='/images/explode.gif'}&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;</pre></td></tr></table></div>

<p>Non faccio altro che dire &#8220;se il div che riempio tramite la chiamata remota ha del contenuto (leggi: è espanso) allora setta il suo contenuto a vuoto e metti come iconcina di nuovo il &#8220;+&#8221; (leggi: chiudilo), altrimenti fai la chiamata remota e l&#8217;iconcina diventa un &#8220;-&#8221; (leggi: espandilo).</p>
<p>Infine la chiamata remota per poter aggiungere nuove sottocategorie ed i div necessari:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div id=&quot;addsottocateg_div&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> link_to_remote<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'+'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
  <span style="color: #0000ff;">'url'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'categorie/aggiungiSotto?id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'update'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'acs_'</span><span style="color: #339933;">.</span><span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'script'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
&lt;div class=&quot;acs&quot; id=&quot;acs_<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;sottocategoria_div&quot; id=&quot;sottocat_<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$categoria</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getIdCategorie</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Tutto questo non sarebbe stato necessario se il mitico sfgWidgetsPlugin avesse una opzione &#8220;scripts => true&#8221; per permettere l&#8217;evaluate di script anche nella destinazione.</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://www.symfony.it/articoli/9/albero-ajax/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.symfony.it/articoli/9/albero-ajax/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Confrontare due campi della stessa tabella con Propel</title>
		<link>http://www.symfony.it/articoli/8/confrontare-due-campi-della-stessa-tabella-con-propel/</link>
		<comments>http://www.symfony.it/articoli/8/confrontare-due-campi-della-stessa-tabella-con-propel/#comments</comments>
		<pubDate>Thu, 19 Jul 2007 13:57:21 +0000</pubDate>
		<dc:creator>kea</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.symfony.it/articoli/8/confrontare-due-campi-della-stessa-tabella-con-propel/</guid>
		<description><![CDATA[Con il criteria di Propel non è possibile ancora confrontare due campi della stessa tabella, ma solo il campo con un valore. Questa feature sarà probabilmente implementata nella versione 2.0. Nel frattempo vi propongo questo trick per confrontare tra loro i campi Campo1 e Campo2 della tabella Tabella 1 2 3 $c = new Criteria&#40;&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>Con il criteria di Propel non è possibile ancora confrontare due campi della stessa tabella, ma solo il campo con un valore.  Questa feature sarà probabilmente implementata nella versione 2.0.</p>
<p>Nel frattempo vi propongo questo trick per confrontare tra loro i campi Campo1 e Campo2 della tabella Tabella</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$c</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Criteria<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add</span><span style="color: #009900;">&#40;</span>Tabella<span style="color: #339933;">.</span>Campo1<span style="color: #339933;">,</span> Tabella<span style="color: #339933;">.</span>Campo1<span style="color: #339933;">.</span><span style="color: #0000ff;">' = '</span><span style="color: #339933;">.</span>Tabella<span style="color: #339933;">.</span>Campo2<span style="color: #339933;">,</span> Criteria<span style="color: #339933;">:</span>CUSTOM<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Naturalmente al posto di &#8220;.&#8217; = &#8216; .&#8221; potere inserire l&#8217;operatore che vi serve (=, &lt;&gt;, !=, &lt;, &gt;, etc.)</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://www.symfony.it/articoli/8/confrontare-due-campi-della-stessa-tabella-con-propel/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' send='false' /></div>]]></content:encoded>
			<wfw:commentRss>http://www.symfony.it/articoli/8/confrontare-due-campi-della-stessa-tabella-con-propel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
