<?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>Blog Symfony - Lexik Montpellier &#187; Bérenger Vidal</title>
	<atom:link href="http://www.lexik.fr/blog/symfony/author/berenger/feed" rel="self" type="application/rss+xml" />
	<link>http://www.lexik.fr/blog/symfony</link>
	<description>Blog sur le développement Web PHP</description>
	<lastBuildDate>Mon, 09 Aug 2010 11:33:56 +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>Stofcplugin : faire de bien jolis graphiques avec symfony</title>
		<link>http://www.lexik.fr/blog/symfony/non-classe/stofcplugin-faire-de-bien-jolis-graphiques-avec-symfony-692</link>
		<comments>http://www.lexik.fr/blog/symfony/non-classe/stofcplugin-faire-de-bien-jolis-graphiques-avec-symfony-692#comments</comments>
		<pubDate>Thu, 18 Jun 2009 16:32:17 +0000</pubDate>
		<dc:creator>Bérenger Vidal</dc:creator>
				<category><![CDATA[Non classé]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[graphique]]></category>
		<category><![CDATA[Stofcplugin]]></category>
		<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://www.lexik.fr/sfblog/?p=692</guid>
		<description><![CDATA[Aujourd&#8217;hui , nous allons découvrir un plugin symfony permettant de réaliser simplement des graphiques en flash à partir d&#8217;un tableau de donnée. Il gère les : Histogrammes Graphique en courbes Graphiques en secteurs Graphiques en barres Graphiques en aires Les graphiques générés sont entièrement paramétrables : choix des couleurs , des titres . L&#8217;installation du [...]]]></description>
			<content:encoded><![CDATA[<p>Aujourd&#8217;hui , nous allons découvrir un plugin symfony permettant de réaliser simplement des graphiques en flash à partir d&#8217;un tableau de donnée.</p>
<p>Il gère les :</p>
<ul>
<li>Histogrammes</li>
<li>Graphique en courbes</li>
<li>Graphiques en secteurs</li>
<li>Graphiques en barres</li>
<li>Graphiques en aires</li>
</ul>
<p><span id="more-692"></span><br />
Les graphiques générés sont entièrement paramétrables : choix des couleurs , des titres .</p>
<p>L&#8217;installation du plugin est très simple :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p692code6'); return false;">View Code</a> YML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6926"><td class="code" id="p692code6"><pre class="yml" style="font-family:monospace;">symfony plugin:install stOfcPlugin</pre></td></tr></table></div>

<p>puis</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p692code7'); return false;">View Code</a> YML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6927"><td class="code" id="p692code7"><pre class="yml" style="font-family:monospace;">symfony cc</pre></td></tr></table></div>

<p>Ensuite , dans le template où l&#8217;on veut afficher le graphique on copie la ligne suivante :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p692code8'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6928"><td class="code" id="p692code8"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>code<span style="color: #339933;">&gt;</span>
stOfc<span style="color: #339933;">::</span><span style="color: #004000;">createChart</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">500</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">300</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'quiz_sondage/pieChartData?slug='</span><span style="color: #339933;">.</span><span style="color: #000088;">$quiz</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getSlug<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> fal
<span style="color: #339933;">&lt;/</span>code<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Les premiers paramètres correspondent à la taille du graphique tandis que le second correspond à la route qui appelle la fonction qui génèrera le graphique.</p>
<p>Si vous ne voulez pas définir une route supplémentaire vous pouvez appelez la fonction comme ceci : module/action</p>
<p>Le readme du contient des exemples pour bien commencé :</p>
<p>http://www.symfony-project.org/plugins/stOfcPlugin</p>
<p>Ce plugin est basé sur un projet open-source, voici l&#8217;adresse :</p>
<p>http://teethgrinder.co.uk/open-flash-chart/</p>
<p>Le site contient toute la doc nécessaire</p>
<p>Et voici l&#8217;adresse du forum d&#8217;aide : ( ça peut toujours servir )</p>
<p>http://forums.openflashchart.com/</p>
<h2>Autre solution pour faire des graphique sans flash : jpgraph</h2>
<p>Pour télécharger la libraire jpgraph : http://www.aditus.nu/jpgraph</p>
<p>On va donc voir comment l&#8217;utiliser avec sympfony :</p>
<p>Télécharger la dernière realease pour <strong>PHP5</strong></p>
<p>Dans un premier temps copier le dossier jpgraph obtenu après la décompression de l&#8217;archive dans le dossier lib de votre projet</p>
<p>Faites un symfony cc</p>
<p>dans le template voulu copier la ligne suivante :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p692code9'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6929"><td class="code" id="p692code9"><pre class="html" style="font-family:monospace;">&lt;code&gt;
&lt;img class=&quot;graph&quot; src=&quot;&amp;lt;?php echo url_for('@actionSouhaité'); ?&amp;gt;&quot; alt=&quot;&quot; /&gt;
&lt;/code&gt;</pre></td></tr></table></div>

<p>&nbsp;&raquo; /&gt;</p>
<p>@actionSouhaité = la route appelant l&#8217;action qui va générer l&#8217;image.</p>
<p>Maintenant on va voir un modèle d&#8217;action pour génèrer l&#8217;image :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p692code10'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p69210"><td class="code" id="p692code10"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> executeGraph<span style="color: #009900;">&#40;</span>sfWebRequest <span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
&nbsp;
      <span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$ydata</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Tableau des valeurs</span>
      <span style="color: #000088;">$xdata</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Tableau axis ( légénde des valeurs )</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// Code pour remplir les tableau comme vous voulez    </span>
&nbsp;
     <span style="color: #666666; font-style: italic;">// Création du graph type courbe</span>
      <span style="color: #000088;">$graph</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Graph<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1300</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">400</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;auto&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$graph</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>SetScale<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;textlin&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$graph</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>title<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>Set<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Evolution du nombre d\'</span>inscription<span style="color: #0000ff;">');
      $graph-&amp;gt;title-&amp;gt;SetFont(FF_FONT1,FS_BOLD);
      $line = new LinePlot($ydata);
      $graph-&amp;gt;Add($line);
      $line-&amp;gt;SetColor(&quot;#36393D&quot;);
      $line-&amp;gt;SetWeight(2);
      $graph-&amp;gt;xaxis-&amp;gt;setTickLabels($xdata);
&nbsp;
      // Output graph
      $graph-&amp;gt;Stroke();
&nbsp;
      return sfView::NONE; // Important pour que l'</span>action retourne que le code de l<span style="color: #0000ff;">'image
    }</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.lexik.fr/blog/symfony/non-classe/stofcplugin-faire-de-bien-jolis-graphiques-avec-symfony-692/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Une infobulle pour l&#8217;admin générator</title>
		<link>http://www.lexik.fr/blog/symfony/symfony/admingenerator-12x/utilisation-admin-generator-astuce-457</link>
		<comments>http://www.lexik.fr/blog/symfony/symfony/admingenerator-12x/utilisation-admin-generator-astuce-457#comments</comments>
		<pubDate>Thu, 09 Apr 2009 13:39:54 +0000</pubDate>
		<dc:creator>Bérenger Vidal</dc:creator>
				<category><![CDATA[Admingenerator 1.2.x]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[generator]]></category>

		<guid isPermaLink="false">http://www.lexik.fr/sfblog/?p=457</guid>
		<description><![CDATA[Voici quelques astuces pour rendre le backend d&#8217;un site généré par symfony accessible au plus grand nombre et de faciliter la compréhension pour l&#8217;administrateur du site Web. Petit rappel, les formulaires sont placés dans le dossier : votre-projet/lib/form et un tuto pour apprendre à les utiliser : Formualires symfony 1.2 Voici deux petites astuces : [...]]]></description>
			<content:encoded><![CDATA[<p>Voici quelques astuces pour rendre le backend d&#8217;un site généré par symfony accessible au plus grand nombre et de faciliter la compréhension pour l&#8217;administrateur du site Web.</p>
<p>Petit rappel, les formulaires sont placés dans le dossier : votre-projet/lib/form<br />
et un tuto pour apprendre à les utiliser :<a title="Formulaires symfony 1.2" href="http://www.symfony-project.org/forms/1_2/"> Formualires symfony 1.2</a></p>
<p><strong>Voici deux  petites astuces :</strong></p>
<p><span id="more-457"></span></p>
<p>Lors de la création d&#8217;un formulaire , il est possible de rajouter une zone html en dessous d&#8217;un champs.<br />
La ligne suivante permet de faire ça :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p457code16'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p45716"><td class="code" id="p457code16"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>widgetSchema<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setHelp<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'champs'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'code html'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Résulat :</p>
<p><img class="alignnone size-full wp-image-471" title="help" src="http://www.lexik.fr/blog/symfony/wp-content/uploads/2009/04/help.jpg" alt="help" width="522" height="54" /></p>
<p>Il est aussi possible d&#8217;injecter du code html dans le label d&#8217;un champs. Partant de ce constat , j&#8217;ai alors créé une petite classe qui va générer une image avec une info-bulle.</p>
<p>On crée en suite le fichier bulle.js dans le dossier web/js. Ce code permet de générer l&#8217;info-bulle.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p457code17'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p45717"><td class="code" id="p457code17"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> GetId<span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">return</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// La variable i nous dit si la bulle est visible ou non</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> move<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  <span style="color: #006600; font-style: italic;">// Si la bulle est visible, on calcul en temps reel sa position ideale</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">appName</span><span style="color: #339933;">!=</span><span style="color: #3366CC;">&quot;Microsoft Internet Explorer&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// Si on est pas sous IE</span>
GetId<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;curseur&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">left</span><span style="color: #339933;">=</span>e.<span style="color: #660066;">pageX</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #339933;">;</span>
GetId<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;curseur&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">top</span><span style="color: #339933;">=</span>e.<span style="color: #660066;">pageY</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// Modif proposé par TeDeum, merci à lui</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">documentElement</span>.<span style="color: #660066;">clientWidth</span><span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
GetId<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;curseur&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">left</span><span style="color: #339933;">=</span><span style="color: #CC0000;">20</span><span style="color: #339933;">+</span>event.<span style="color: #660066;">x</span><span style="color: #339933;">+</span>document.<span style="color: #660066;">documentElement</span>.<span style="color: #660066;">scrollLeft</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #339933;">;</span>
GetId<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;curseur&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">top</span><span style="color: #339933;">=</span><span style="color: #CC0000;">10</span><span style="color: #339933;">+</span>event.<span style="color: #660066;">y</span><span style="color: #339933;">+</span>document.<span style="color: #660066;">documentElement</span>.<span style="color: #660066;">scrollTop</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
GetId<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;curseur&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">left</span><span style="color: #339933;">=</span><span style="color: #CC0000;">20</span><span style="color: #339933;">+</span>event.<span style="color: #660066;">x</span><span style="color: #339933;">+</span>document.<span style="color: #660066;">body</span>.<span style="color: #660066;">scrollLeft</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #339933;">;</span>
GetId<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;curseur&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">top</span><span style="color: #339933;">=</span><span style="color: #CC0000;">10</span><span style="color: #339933;">+</span>event.<span style="color: #660066;">y</span><span style="color: #339933;">+</span>document.<span style="color: #660066;">body</span>.<span style="color: #660066;">scrollTop</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> montre<span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">==</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
GetId<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;curseur&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">visibility</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;visible&quot;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Si il est cacher (la verif n'est qu'une securité) on le rend visible.</span>
GetId<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;curseur&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> text<span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Cette fonction est a améliorer, il parait qu'elle n'est pas valide (mais elle marche)</span>
i<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> cache<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">==</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
GetId<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;curseur&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">visibility</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;hidden&quot;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Si la bulle etais visible on la cache</span>
i<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
document.<span style="color: #660066;">onmousemove</span><span style="color: #339933;">=</span>move<span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// des que la souris bouge, on appelle la fonction move pour mettre a jour la position de la bulle.</span>
<span style="color: #006600; font-style: italic;">//--&amp;gt;</span></pre></td></tr></table></div>

<p>Puis on crée le fichier bt.css dans le dossier  web/css. Ce fichier permet de modifier l&#8217;aspect de l&#8217;info-bulle pour qu&#8217;elle soit assortie au backend.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p457code18'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p45718"><td class="code" id="p457code18"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.infobulle</span>
<span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">visibility</span> <span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#CC0000</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Verdana<span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Ensuite , on crée le fichier bulle.class.php dans le dossier lib du projet</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p457code19'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p45719"><td class="code" id="p457code19"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> bulle
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #990000;">static</span> <span style="color: #000000; font-weight: bold;">function</span> bubble<span style="color: #009900;">&#40;</span><span style="color: #000088;">$Message</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;a onmouseover=&quot;montre(\'</span><span style="color: #0000ff;">'.$Message.'</span>\<span style="color: #0000ff;">');&quot; onmouseout=&quot;cache()&quot; href=&quot;#&quot;&gt;&lt;img src=&quot;../images/aide.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&amp;amp;nbsp;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Une dernière chose, il faut maintenant inclure une div dans la page où est affiché le formulaire. pour cela on va sur-définir le fichier : _form_header.php</p>
<p>Il est à placé dans le dossier : votre-pojet/apps/backend/modules/votre-module/templates</p>
<p>Ensuite il suffit de rajouter bulle::bubble( texte a affiché dans la bulle ) quand on implémente le label</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p457code20'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p45720"><td class="code" id="p457code20"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>widgetSchema<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setLabel<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #339933;">,</span>bulle<span style="color: #339933;">::</span><span style="color: #004000;">bubble</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Référence du contenu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'Référence'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>Résultat : </strong></p>
<p><img class="alignnone size-full wp-image-470" title="bulle" src="http://www.lexik.fr/blog/symfony/wp-content/uploads/2009/04/bulle.jpg" alt="bulle" width="500" /></p>
<p>Ainsi vous pouvez donner le maximum d&#8217;information sur l&#8217;impact d&#8217;un champs pour que l&#8217;administrateur du site internet sache ce qu&#8217;il fait</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lexik.fr/blog/symfony/symfony/admingenerator-12x/utilisation-admin-generator-astuce-457/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
