<?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>Itanea le Blog &#187; dojotoolkit</title>
	<atom:link href="http://www.itanea.com/blog/tag/dojotoolkit/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.itanea.com/blog</link>
	<description>Techno, Développement, Entreprendre et au-delà !</description>
	<lastBuildDate>Thu, 18 Feb 2010 22:33:19 +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>Zend Framework : Ajouter un sélecteur de date sympa dans vos formulaires sans écrire une seule ligne de JavaScript</title>
		<link>http://www.itanea.com/blog/2008/09/25/zend-framework-ajouter-un-selecteur-de-date-sympa-dans-vos-formulaires-sans-ecrire-une-seule-ligne-de-javascript/</link>
		<comments>http://www.itanea.com/blog/2008/09/25/zend-framework-ajouter-un-selecteur-de-date-sympa-dans-vos-formulaires-sans-ecrire-une-seule-ligne-de-javascript/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 16:52:14 +0000</pubDate>
		<dc:creator>Fred Blanc</dc:creator>
				<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Tutoriels]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web2.0]]></category>
		<category><![CDATA[aide de vue]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[date picker]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[dojotoolkit]]></category>
		<category><![CDATA[formulaire]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[sélecteur de date]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zend_controller]]></category>
		<category><![CDATA[Zend_Dojo]]></category>
		<category><![CDATA[Zend_Form]]></category>
		<category><![CDATA[zend_layout]]></category>

		<guid isPermaLink="false">http://www.itanea.com/blog/?p=329</guid>
		<description><![CDATA[Cet article est une traduction du billet de Sudheer Satyanarayana que vous retrouverez en VO sur LampComputing Les utilisateurs du Zend Framework savent que le toolkit Dojo est intégré depuis la version 1.6. Dans un post précédent, j&#8217;ai expliquer comment ajouter un selecteur de date Dojo sympa dans votre élément texte de formulaire en codant [...]]]></description>
			<content:encoded><![CDATA[<div class="content"><span class="important">Cet article est une traduction du billet de <a href="http://sudheer.net/about" target="_blank">Sudheer Satyanarayana</a> que vous retrouverez en VO sur <a title="Ajouter un date Picker dojo avec Zend_Dojo sans programmer une seule ligne de code JavaScript" href="http://lampcomputing.com/add-cool-zend-dojo-date-picker-form-element-without-writing-single-line-javascript" target="_blank">LampComputing</a></span></div>
<p>Les utilisateurs du Zend Framework savent que le toolkit Dojo est intégré depuis la version 1.6. Dans un post précédent, j&#8217;ai expliquer comment ajouter un selecteur de date Dojo sympa dans votre élément texte de formulaire en codant manuellement le JavaScript nécessaire. Dans le billet d&#8217;aujourd&#8217;hui, nous allons voir comment créer le même élément avec Zend_Dojo. Comme l&#8217;indique le titre, vous n&#8217;aurez pas à écrire une seule ligne de code JavaScript. Zend_Dojo effectuera tout le travail pour vous.</p>
<p><strong>Prérequis :</strong> vous devez être à l&#8217;aise avec Zend_Form, Zend_Controller et Zend_Layout.<span id="more-329"></span></p>
<p><strong>Bootstrap</strong> : Le Zend Framework est fourni avec plusieurs helpers de vue Dojo. Vous devez permettre à l&#8217;objet view de trouver les aides de vue Dojo.</p>
<p>Localisez l&#8217;objet de vue et ajoutez la ligne suivante dans votre fichier de bootstrap.</p>
<div class="codeblock">

<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('p329code11'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32911"><td class="code" id="p329code11"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// Créer un nouvel objet s'il n'est pas déjà instancié</span>
<span style="color: #666666; font-style: italic;">//$view = new Zend_View();</span>
Zend_Dojo<span style="color: #339933;">::</span><span style="color: #004000;">enableView</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$view</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>

</div>
<p>Cela va paramétrer l&#8217;environnement Dojo et utilise AOL CDN (Content Delivery Network) par défaut. Cela ne sera à configurer qu&#8217;une seule fois pour votre application. Vous pouvez utiliser les méthodes disponibles d&#8217;helpers de vue pour spécifier un CDN (Content Delivery Network) ou un chemin local pour l&#8217;installation de Dojo, des chemins pour les modules personnalisés de Dojo, les déclarations dojo.require, les styles et thèmes Dojo à utiliser et pour crééer les évènements dojo.addOnLoad().</p>
<p><strong>Création du formulaire </strong>:</p>
<div class="codeblock">

<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('p329code12'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32912"><td class="code" id="p329code12"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$form</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Form<span style="color: #339933;">;</span>
<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'text'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLabel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Your full name'</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setRequired</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</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>

</div>
<p>Le code ci-dessus créée un nouvelle objet formulaire et  un champ text. A l&#8217;étape suivante, nous allons créée le sélecteur de date de la même manière.</p>
<p>Nous allons appeler notre champ sélecteur de date &#8216;birthday&#8217;. Nous utiliserons pour cette exemple le widget Dojo DateTextBox.</p>
<div class="codeblock">

<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('p329code13'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32913"><td class="code" id="p329code13"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$birthday</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Dojo_Form_Element_DateTextBox<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'birthday'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$birthday</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLabel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Birthday'</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>

</div>
<p>Les deux lignes ci-dessus crééent le champ de formulaire de type DateTextBox en lui assignant le label &#8216;Birthday&#8217;. Cela génère à peu près ce code lorsque vous affichez le formulaire.</p>
<div class="codeblock">

<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('p329code14'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32914"><td class="code" id="p329code14"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span> indicative output <span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;date&quot;</span>  dojoType<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;dijit.form.DateTextBox&quot;</span> <span style="color: #339933;">/&gt;</span></pre></td></tr></table></div>

</div>
<p>Créér le champ submit et ajouter tous les champs au formulaire.</p>
<div class="codeblock">

<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('p329code15'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32915"><td class="code" id="p329code15"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$submit</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'submit'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'submit'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElements</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$birthday</span><span style="color: #339933;">,</span> <span style="color: #000088;">$submit</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>

</div>
<p>Nous en avons fini avec la création du formulaire. Je poste ci-dessous le code complet du controlleur qui contient la fonction pour créer le formulaire.</p>
<div class="codeblock">

<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('p329code16'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32916"><td class="code" id="p329code16"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> IndexController <span style="color: #000000; font-weight: bold;">extends</span> Zend_Controller_Action
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> indexAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// Appel de la fonction getForm()</span>
<span style="color: #000088;">$form</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getForm</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_request<span style="color: #339933;">-&gt;</span><span style="color: #004000;">isPost</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isValid</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// Traitement des données</span>
<span style="color: #666666; font-style: italic;">// Passer les valeurs de name et birthday à la vue</span>
<span style="color: #666666; font-style: italic;">// vous pourrez ainsi les afficher dans la vue</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_getParam<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</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;">view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">birthday</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_getParam<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'birthday'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// Si la validation du formulaire échoue, on le repeuple et on l'affiche à nouveau</span>
<span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">populate</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</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;">view</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>form <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// Si la requête, n'est pas de type POST, on affiche le formulaire</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// Fonction pour crééer le formulaire</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getForm<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$form</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Form<span style="color: #339933;">;</span>
<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'text'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLabel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Your full name'</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">setRequired</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$birthday</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Dojo_Form_Element_DateTextBox<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'birthday'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$birthday</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setLabel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Birthday'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$submit</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'submit'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'submit'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElements</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$birthday</span><span style="color: #339933;">,</span> <span style="color: #000088;">$submit</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Nous avons déjà parlé de ce que réalise le code ci-dessus</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$form</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</div>
<p>Lorsque le formulaire est soumis, on peut accéder aux valeurs de &#8216;name&#8217; et de &#8216;birthday&#8217; en utilisant la méthode habituelle $this->_getParam(). Depuis le controlleur, on passe les valeurs de &#8216;name&#8217; et &#8216;birthday&#8217; à la vue, comme cela nous pourrons les afficher dans notre vue.</p>
<p>Ajouter le code suivant à votre fichier vue pour afficher les valeurs de &#8216;name&#8217; et &#8216;birthday&#8217; renseignées par l&#8217;utilisateur.</p>
<div class="codeblock">

<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('p329code17'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32917"><td class="code" id="p329code17"><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: #0000ff;">&quot;Votre nom est &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Votre anniversaire est le &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">birthday</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span> <span style="color: #339933;">;</span>
<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

</div>
<p>Dans votre script de layout, vous devez ajouter vos modules de feuilles de style et afficher l&#8217;objet Dojo. Dans cet exemple, nous utilisons la feuille de style tundra.</p>
<div class="codeblock">

<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('p329code18'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32918"><td class="code" id="p329code18"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">escape</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">pageTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot; - Binary Vibes BizSense&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addStylesheetModule</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dijit.themes.tundra'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

</div>
<p>N&#8217;oubliez pas donner la classe &#8216;tundra&#8217; à votre balise body.</p>
<div class="codeblock">

<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('p329code19'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32919"><td class="code" id="p329code19"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>body <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tundra&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;content&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">layout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">content</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

</div>
<p>Je publie ci-dessous l&#8217;exemple complet du script de layout pour vous servir de référence.</p>
<div class="codeblock">

<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('p329code20'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32920"><td class="code" id="p329code20"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!</span>DOCTYPE html <span style="color: #000000; font-weight: bold;">PUBLIC</span> <span style="color: #0000ff;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span>
<span style="color: #0000ff;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>html xmlns<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.w3.org/1999/xhtml&quot;</span> xml<span style="color: #339933;">:</span>lang<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;en&quot;</span> lang<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;en&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>meta http<span style="color: #339933;">-</span>equiv<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Content-Type&quot;</span> content<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>Binary Vibes BizSense<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dojo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addStylesheetModule</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dijit.themes.tundra'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tundra&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;content&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">layout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">content</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

</div>
<p>C&#8217;est tout ce qu&#8217;il ya à faire pour utiliser les widgets de formulaire Dojo dans votre application propulsée par le Zend Framework</p>
<p><strong>Références </strong>:<br />
(fr) Zend_Dojo &#8211; <a class="ext" title="http://framework.zend.com/manual/en/zend.dojo.html" href="http://framework.zend.com/manual/en/zend.dojo.html" target="_blank">http://framework.zend.com/manual/fr/zend.dojo.html</a><br />
(en) Dojotoolkit &#8211; <a class="ext" title="http://dojotoolkit.org/" href="http://dojotoolkit.org/" target="_blank">http://dojotoolkit.org/<br />
</a>(en) Plain HTML and JavaScript DateTextBox usage example &#8211; <a title="http://lampcomputing.com/add-cool-date-picker-2-lines-javascript" href="http://lampcomputing.com/add-cool-date-picker-2-lines-javascript">http://lampcomputing.com/add-cool-date-picker-2-lines-javascript</a><br />
(fr) Dojotoolkit France : <a title="Dojotoolkit France" href="http://www.dojotoolkit-fr.org/" target="_blank">http://www/dojotoolkit-fr.org</a><br />
(fr) La communauté Française Zend Framework : <a title="La communauté francophone du Zend Framework" href="http://www.z-f.fr/" target="_blank">http://www.z-f.fr/</a></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://www.itanea.com/blog/2008/12/15/zend-framework-tutoriel-exemple-d-auto-completion-avec-zend_dojo_form_element_filteringselect-et-zend_dojo_data/" rel="bookmark" class="crp_title">Zend Framework : exemple d&#039;auto-complétion avec Zend_Dojo</a></li><li><a href="http://www.itanea.com/blog/2008/05/04/login-et-authentification-avec-le-zend-framework/" rel="bookmark" class="crp_title">Login et authentification avec le Zend Framework</a></li><li><a href="http://www.itanea.com/blog/2008/07/30/zend-framework-sortie-1-5-3-stable-et-arrivee-1-6-0-rc1/" rel="bookmark" class="crp_title">Zend Framework : sortie de la 1.5.3 Stable et arrivée de la 1.6.0 RC1</a></li><li><a href="http://www.itanea.com/blog/2008/11/27/zend-framework-utiliser-zend-framework-et-doctrine-auteur-ruben-vermeersch-traduction-fred-blanc/" rel="bookmark" class="crp_title">Zend framework : Utiliser Zend Framework et Doctrine (Auteur Ruben Vermeersch, Traduction Fred Blanc)</a></li><li><a href="http://www.itanea.com/blog/2008/08/10/tutoriel-zend-framework-integrez-vos-feuilles-de-styles-specifiques-a-internet-explorer-via-headlink/" rel="bookmark" class="crp_title">Tutoriel Zend Framework : Intégrez vos feuilles de styles spécifiques à Internet Explorer via headLink</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.itanea.com/blog/2008/09/25/zend-framework-ajouter-un-selecteur-de-date-sympa-dans-vos-formulaires-sans-ecrire-une-seule-ligne-de-javascript/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
