<?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, 26 Jul 2010 09:23:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<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[libro]]></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>
]]></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 "equal nested relation". Queste relazioni tra oggetti sono quelle relazioni che possono essere tradotte (per quanto riguarda il database) con un "auto join" su una stessa tabella. Un esempio pratico lo potete trovare fra gli esempi del sito dell'ORM Doctrine [...]]]></description>
			<content:encoded><![CDATA[<p>Non so se vi è mai capitato di avere a che fare con le cosiddette "equal nested relation". Queste relazioni tra oggetti sono quelle relazioni che possono essere tradotte (per quanto riguarda il database) con un "auto join" su una stessa tabella.</p>
<p>Un esempio pratico lo potete trovare fra gli esempi del sito dell'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>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">500</span> | Internal Server Error</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Doctrine_Connection_Mysql_Exception SQLSTATE23000: Integrity constraint violation: <span style="color:#800000;color:#800000;">1062</span> Duplicate entry <span style="color:#CC0000;">'N-N'</span> for key <span style="color:#800000;color:#800000;">1</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<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'è 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'ora siamo arrivati a capire dov'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>. Ricondo che questa <strong>NON E' UNA SOLUZIONE DEFINITIVA</strong>. <strong>E' 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>
]]></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>1</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'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 pò di tempo e che [...]]]></description>
			<content:encoded><![CDATA[<p>Ultimamente mi è capitato di lavorare con Doctrine all'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 pò 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>
<div class="igBar"><span id="lcode-8"><a href="#" onclick="javascript:showPlainTxt('code-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-8">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$this-&gt;<span style="">validatorSchema</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">'users_list'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = new sfValidatorDoctrineChoiceMany<span style="color:#006600; font-weight:bold;">&#40;</span>array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'model'</span> =&gt; <span style="color:#CC0000;">'User'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></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 'query' al mio validatore.</p>
<div class="igBar"><span id="lcode-9"><a href="#" onclick="javascript:showPlainTxt('code-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-9">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$q = Doctrine_Query::<span style="">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-&gt;<span style="">from</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'User u'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-&gt;<span style="">where</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'u.name = '</span>.$name<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$this-&gt;<span style="">validatorSchema</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">'users_list'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = new sfValidatorDoctrineChoiceMany<span style="color:#006600; font-weight:bold;">&#40;</span>array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'model'</span> =&gt; <span style="color:#CC0000;">'User'</span> ,<span style="color:#CC0000;">'query'</span> =&gt; $q<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>A questo punto però mi sono trovato di fronte all'errore</p>
<blockquote><p>500 | Internal Server Error | Doctrine_Exception</p>
<p>Couldn't find class a</p></blockquote>
<p>Non avendo nessuna classe (ne alias) 'a' definita nel modello mi sono girato un pò i log che vengono forniti da symfony e ho scoperto che sfValidatorDoctrineChoiceMany, durante il cleaning dei valori in input, esegue la query aggiungendo un'opzione al 'where':</p>
<p><em>sfValidatorDoctrineChoiceMany.class.php</em></p>
<div class="igBar"><span id="lcode-10"><a href="#" onclick="javascript:showPlainTxt('code-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-10">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$a = $this-&gt;<span style="">getOption</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'alias'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$q = is_null<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">getOption</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'query'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? Doctrine_Query::<span style="">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>-&gt;<span style="">from</span><span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">getOption</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'model'</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#CC0000;">' '</span> . $a<span style="color:#006600; font-weight:bold;">&#41;</span> : $this-&gt;<span style="">getOption</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'query'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$q = $q-&gt;<span style="">andWhereIn</span><span style="color:#006600; font-weight:bold;">&#40;</span>$a . <span style="color:#CC0000;">'.'</span> . $this-&gt;<span style="">getColumn</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, $values<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$objects = $q-&gt;<span style="">execute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">... </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Queto comportamento è giusto per il classico meccanismo di doctrine di inserire un alias quando si esegue una query del tipo</p>
<div class="igBar"><span id="lcode-11"><a href="#" onclick="javascript:showPlainTxt('code-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-11">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$this-&gt;<span style="">status_list</span> = Doctrine::<span style="">getTable</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'User'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; -&gt;<span style="">createQuery</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'a'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; -&gt;<span style="">execute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<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'opzione 'alias'</p>
<div class="igBar"><span id="lcode-12"><a href="#" onclick="javascript:showPlainTxt('code-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-12">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$this-&gt;<span style="">validatorSchema</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC0000;">'users_list'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = new sfValidatorDoctrineChoiceMany<span style="color:#006600; font-weight:bold;">&#40;</span>array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'model'</span> =&gt; <span style="color:#CC0000;">'User'</span>, <span style="color:#CC0000;">'alias'</span> =&gt; <span style="color:#CC0000;">''</span> ,<span style="color:#CC0000;">'query'</span> =&gt; $q<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Spero che questo appunto possa darvi una mano se mai vi troverete di fronte alla mia stessa situazione.</p>
<p>Buono "sviluppo" a tutti!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony.it/articoli/137/symfony-doctrine-e-validatori/feed/</wfw:commentRss>
		<slash:comments>3</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'ottimo IDE per windows phpEdit, ha annunciato il supporto per Symfony all'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'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'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'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>
]]></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'interno dell'Issue Tracking di NetBeans, Sun ha annunciato che sono già iniziati i lavori per supportare ufficialmente Symfony nella versione 7.0 dell'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'<a href="http://www.netbeans.org/issues/show_bug.cgi?id=145913">interno dell'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'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 "Eclipse" fatta da Zend come motore dello Zend Studio.</p>
]]></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'altra url http://localhost/test/a.b.c il risultato sarà un errore 4040 "The requested URL /test/a.bc was not found on this server.".</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'url http://localhost/test/a.b.c si otterrà nel browser il risultato voluto, cioè la stringa "a.b.c"</p>
]]></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. La template è fatta circa così: PLAIN TEXT CODE: &#60;?php echo __&#40;'Aggiungi prodotto'&#41; ?&#62;&#60;input type="button" value="+" onclick="addprod()" /&#62; &#60;?php echo javascript_tag&#40;" &#160; &#160; function addprod() { &#160; &#160; &#160; &#160; alert('ciao') &#160; &#160; } "&#41; ?&#62; Se chiamata "direttamente", questa template funziona è [...]]]></description>
			<content:encoded><![CDATA[<p>Oggi dovevo eseguire del codice Javascript nel risultato di una chiamata ajax. La template è fatta circa così:</p>
<div class="igBar"><span id="lcode-15"><a href="#" onclick="javascript:showPlainTxt('code-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-15">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php echo __<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'Aggiungi prodotto'</span><span style="color:#006600; font-weight:bold;">&#41;</span> ?&gt;&lt;input type=<span style="color:#CC0000;">"button"</span> value=<span style="color:#CC0000;">"+"</span> onclick=<span style="color:#CC0000;">"addprod()"</span> /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php echo javascript_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; function addprod() { </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &nbsp; &nbsp; alert('ciao')</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; }</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">"</span><span style="color:#006600; font-weight:bold;">&#41;</span> ?&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Se chiamata "direttamente", questa template funziona è visualizzerà correttamente l'alert. Ciò non si verificherà invece se la 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 la template deve essere riscritta nel seguente modo:</p>
<div class="igBar"><span id="lcode-16"><a href="#" onclick="javascript:showPlainTxt('code-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-16">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php echo __<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'Aggiungi prodotto'</span><span style="color:#006600; font-weight:bold;">&#41;</span> ?&gt;&lt;input type=<span style="color:#CC0000;">"button"</span> value=<span style="color:#CC0000;">"+"</span> onclick=<span style="color:#CC0000;">"addprod()"</span> /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php echo javascript_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; addprod = function() { </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; &nbsp; &nbsp; alert('alora')</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; }</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">"</span><span style="color:#006600; font-weight:bold;">&#41;</span> ?&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>in modo che la funzione venga <em>creata</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.symfony.it/articoli/14/javascript-ajax-eval/feed/</wfw:commentRss>
		<slash:comments>3</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="igBar"><span id="lcode-22"><a href="#" onclick="javascript:showPlainTxt('code-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-22">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">private function getCategorie<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$c = new Criteria<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$c-&gt;<span style="">addAscendingOrderByColumn</span><span style="color:#006600; font-weight:bold;">&#40;</span>CategoriePeer::<span style="">CATEGORIE</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$this-&gt;<span style="">categorie</span> = CategoriePeer::<span style="">doSelect</span><span style="color:#006600; font-weight:bold;">&#40;</span>$c<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$this-&gt;<span style="">forward404Unless</span><span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">categorie</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Dopodichè,  nella template, ciclo sulle tuple trovate:</p>
<div class="igBar"><span id="lcode-23"><a href="#" onclick="javascript:showPlainTxt('code-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-23">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php foreach <span style="color:#006600; font-weight:bold;">&#40;</span>$categorie as $categoria<span style="color:#006600; font-weight:bold;">&#41;</span>: ?&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;p class=<span style="color:#CC0000;">"categoria"</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;p class=<span style="color:#CC0000;">"catname_div"</span>&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Voglio mettere l'iconcina con il classico "+" nel caso ci sia almeno una sottocategoria, per cui:</p>
<div class="igBar"><span id="lcode-24"><a href="#" onclick="javascript:showPlainTxt('code-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-24">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php $c = new Criteria<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; $c-&gt;<span style="">add</span><span style="color:#006600; font-weight:bold;">&#40;</span>SottocategoriePeer::<span style="">RIF_CATEGORIE</span>, $categoria-&gt;<span style="">getIdCategorie</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, Criteria::<span style="">EQUAL</span><span style="color:#006600; font-weight:bold;">&#41;</span>; $sottocat_count = SottocategoriePeer::<span style="">doCount</span><span style="color:#006600; font-weight:bold;">&#40;</span>$c<span style="color:#006600; font-weight:bold;">&#41;</span>; ?&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php if <span style="color:#006600; font-weight:bold;">&#40;</span>$sottocat_count&gt; <span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> echo image_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'explode.gif'</span>, array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'id'</span> =&gt; <span style="color:#CC0000;">'img_'</span>.$categoria-&gt;<span style="">getIdCategorie</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; ?&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<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'albero che per chiuderlo. Per questo motivo la chiamata ajax deve essere condizionale con un ramo else, cosa non permessa dall'helper, per cui vado a mano:</p>
<div class="igBar"><span id="lcode-25"><a href="#" onclick="javascript:showPlainTxt('code-25'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-25">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;a href=<span style="color:#CC0000;">"#"</span> onclick=<span style="color:#CC0000;">"if (document.getElementById('sottocat_&lt;?php echo $categoria-&gt;getIdCategorie() ?&gt;').innerHTML == '') {new Ajax.Updater('sottocat_&lt;?php echo $categoria-&gt;getIdCategorie() ?&gt;', 'categorie/trovasotto/id/&lt;?php echo $categoria-&gt;getIdCategorie() ?&gt;', {asynchronous:true, evalScripts:true, onComplete:function(request, json){document.getElementById('img_&lt;?php echo $categoria-&gt;getIdCategorie() ?&gt;').src='/images/implode.gif'; Element.hide('indicator');}, onLoading:function(request, json){Element.show('indicator')}}); return false;} else {document.getElementById('sottocat_&lt;?php echo $categoria-&gt;getIdCategorie() ?&gt;').innerHTML = ''; document.getElementById('img_&lt;?php echo $categoria-&gt;getIdCategorie() ?&gt;').src='/images/explode.gif'}"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php echo $categoria-&gt;<span style="">getCategorie</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> ?&gt;&lt;/a&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Non faccio altro che dire "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 "+" (leggi: chiudilo), altrimenti fai la chiamata remota e l'iconcina diventa un "-" (leggi: espandilo).</p>
<p>Infine la chiamata remota per poter aggiungere nuove sottocategorie ed i div necessari:</p>
<div class="igBar"><span id="lcode-26"><a href="#" onclick="javascript:showPlainTxt('code-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-26">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;div id=<span style="color:#CC0000;">"addsottocateg_div"</span>&gt;&lt;?php echo link_to_remote<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'+'</span>, array<span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0000;">'url'</span> =&gt; <span style="color:#CC0000;">'categorie/aggiungiSotto?id='</span>.$categoria-&gt;<span style="">getIdCategorie</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0000;">'update'</span> =&gt; <span style="color:#CC0000;">'acs_'</span>.$categoria-&gt;<span style="">getIdCategorie</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0000;">'script'</span> =&gt; true,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> ?&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/div&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;div class=<span style="color:#CC0000;">"acs"</span> id=<span style="color:#CC0000;">"acs_&lt;?php echo $categoria-&gt;getIdCategorie() ?&gt;"</span>&gt;&lt;/div&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;div class=<span style="color:#CC0000;">"sottocategoria_div"</span> id=<span style="color:#CC0000;">"sottocat_&lt;?php echo $categoria-&gt;getIdCategorie() ?&gt;"</span>&gt;&lt;/div&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/div&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;?php endforeach; ?&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Tutto questo non sarebbe stato necessario se il mitico sfgWidgetsPlugin avesse una opzione "scripts => true" per permettere l'evaluate di script anche nella destinazione.</p>
]]></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[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 PLAIN TEXT CODE: $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="igBar"><span id="lcode-28"><a href="#" onclick="javascript:showPlainTxt('code-28'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-28">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$c = new Criteria<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$c-&gt;<span style="">add</span><span style="color:#006600; font-weight:bold;">&#40;</span>Tabella.<span style="">Campo1</span>, Tabella.<span style="">Campo1</span>.<span style="color:#CC0000;">' = '</span>.<span style="">Tabella</span>.<span style="">Campo2</span>, Criteria:CUSTOM<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Naturalmente al posto di ".' = ' ." potere inserire l'operatore che vi serve (=, &lt;&gt;, !=, &lt;, &gt;, etc.)</p>
]]></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! -->