<?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>netinfluence&#039;s blog &#187; php</title>
	<atom:link href="http://blog.netinfluence.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.netinfluence.com</link>
	<description>le blog de l&#039;agence netinfluence</description>
	<lastBuildDate>Fri, 13 Jan 2012 10:39:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Ar-PHP : boite à outils pour gérer les spécificités de la langue arabe</title>
		<link>http://blog.netinfluence.com/2010/07/12/ar-php-boite-a-outils-pour-gerer-les-specificites-de-la-langue-arabe/</link>
		<comments>http://blog.netinfluence.com/2010/07/12/ar-php-boite-a-outils-pour-gerer-les-specificites-de-la-langue-arabe/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 08:52:01 +0000</pubDate>
		<dc:creator>netinfluence</dc:creator>
				<category><![CDATA[create]]></category>
		<category><![CDATA[Développement]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.netinfluence.ch/?p=2001</guid>
		<description><![CDATA[Ar-PHP est une librairie PHP qui apporte un certain nombre d&#8217;outils pratiques pour les utilisateurs arabophones. De part sa spécificité, la langue arabe n&#8217;est pas toujours très bien gérée dans les logiciels actuels. Lorsqu&#8217;on désire mettre en place un site web en arabe, et plus particulièrement destiné au monde arabe, il est nécessaire de disposer d&#8217;un certains nombres d&#8217;outils afin de rendre le site le plus agréable possible pour les utilisateurs. Voici une liste non exhaustive des principales fonctionnalités offertes par Ar-PHP : Conversion de dates entre le calendrier grégorien et hégirien ; Conversion de dates hégiriennes en timestamp Unix ; Translitération de mots anglais en arabe et vice versa ; Détection et application d&#8217;un character set ; Détection de [...]]]></description>
			<content:encoded><![CDATA[<p>Ar-PHP est une librairie PHP qui apporte un certain nombre d&#8217;outils pratiques pour les utilisateurs arabophones. De part sa spécificité, la langue arabe n&#8217;est pas toujours très bien gérée dans les logiciels actuels. Lorsqu&#8217;on désire mettre en place un site web en arabe, et plus particulièrement destiné au monde arabe, il est nécessaire de disposer d&#8217;un certains nombres d&#8217;outils afin de rendre le site le plus agréable possible pour les utilisateurs. Voici une liste non exhaustive des principales fonctionnalités offertes par Ar-PHP :</p>
<ul>
<li>Conversion de dates entre le calendrier grégorien et <a href="http://fr.wikipedia.org/wiki/Calendrier_musulman" target="_blank">hégirien</a> ;</li>
<li>Conversion de dates hégiriennes en timestamp Unix ;</li>
<li>Translitération de mots anglais en arabe et vice versa ;</li>
<li>Détection et application d&#8217;un character set ;</li>
<li>Détection de texte en arabe dans un document multilingue ;</li>
<li>Calcul des horaires de prière en fonction des coordonnées GPS ;</li>
<li>Clavier arabe virtuel en javascript ;</li>
<li>Normalisation du texte arabe.</li>
</ul>
<p>Certaines des fonctionnalités offertes par cette librairie s&#8217;avèrent rapidement indispensables si on souhaite gérer au mieux les spécificités de la langue arabe.</p>
<p>Ce projet est développé par Khaled Al-Sham&#8217;aa en opensource. L&#8217;installation se fait soit par PEAR, soit en téléchargeant directement le code source. Pour découvrir plus en détail cette librairie, rendez-vous sur le site web du projet : <a href="http://www.ar-php.org/en_index-php-arabic.html">http://www.ar-php.org</a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.netinfluence.com/2010/07/12/ar-php-boite-a-outils-pour-gerer-les-specificites-de-la-langue-arabe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bargento 4</title>
		<link>http://blog.netinfluence.com/2010/05/30/bargento-4/</link>
		<comments>http://blog.netinfluence.com/2010/05/30/bargento-4/#comments</comments>
		<pubDate>Sun, 30 May 2010 15:34:26 +0000</pubDate>
		<dc:creator>julien</dc:creator>
				<category><![CDATA[care]]></category>
		<category><![CDATA[bargento]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.netinfluence.ch/?p=1874</guid>
		<description><![CDATA[Le vendredi 28 mai dernier a eu lieu le Bargento 4 à Paris. Voici un petit résumé de l&#8217;événement qui a tout de même réuni 650 personnes autour de Magento Visiblement, Magento se porte plutôt bien ! Une nouvelle version &#8220;Professionnelle&#8221;, une version iPhone (native), des chiffres tous dans le noir. L&#8217;équipe de chaume pas ! L&#8217;essentiel des conférences ne s&#8217;adressent pas particulièrement aux développeurs, mais plus aux e-commerçants ou aux équipes commerciales des prestataires. Ceci dit, j&#8217;ai tout de même trouvé mon compte dans les rencontres et certaines présentations. Celle de Zend (Utiliser les outils Zend pour le développement et la production) par exemple abordant le monitoring d&#8217;application Php. J&#8217;avais déjà vu une présentation du genre, mais chaque fois [...]]]></description>
			<content:encoded><![CDATA[<p>Le vendredi 28 mai dernier a eu lieu le <a href="http://www.bargento.fr/bargento-4/presentation-du-bargento-4/">Bargento 4</a> à Paris. Voici un petit résumé de l&#8217;événement qui a tout de même réuni 650 personnes autour de <a href="http://www.magentocommerce.com/fr/">Magento</a></p>
<p>Visiblement, Magento se porte plutôt bien ! Une nouvelle version &#8220;Professionnelle&#8221;, une version iPhone (native), des chiffres tous dans le noir. L&#8217;équipe de chaume pas !</p>
<p>L&#8217;essentiel des conférences ne s&#8217;adressent pas particulièrement aux développeurs, mais plus aux e-commerçants ou aux équipes commerciales des prestataires. Ceci dit, j&#8217;ai tout de même trouvé mon compte dans les rencontres et certaines présentations.</p>
<p>Celle de Zend (Utiliser les outils Zend pour le développement et la production) par exemple abordant le monitoring d&#8217;application Php. J&#8217;avais déjà vu une présentation du genre, mais chaque fois que je revois le zend server en action, je me dis qu&#8217;il m&#8217;en faut un <img src='http://blog.netinfluence.com/wp-content/plugins/smilies-themer/Silk/emoticon_wink.png' alt=';-)' class='wp-smiley' /> Ca donne envie de faire des bugs, rien que pour utiliser l&#8217;outil. Pour faire simple, entre autres fonctionnalités, le zend server permet de générer une trace particulièrement complète (contenu de la requête, variables, liste des méthodes parcourues) lors d&#8217;une erreur. La détection et l&#8217;affichage des erreurs sont configurables. Vous pouvez par exemple spécifier à partir de combien de temps une requête est considérer comme lente. La trace peut finalement être exportée et visualisée sur Zend Studio par un développeur. Vous trouverez plus de détails sur le site de <a href="http://www.zend.com/fr/products/server/">zend</a>. En avant première, nous avons également appris qu&#8217;une nouvelle version du zend server (cluster manager) permettant de gérer des clusters de zend servers allait sortir dans peu de temps.</p>
<p>J&#8217;ai également beaucoup aimé la présentation de Cybercité (Les Do et les Don&#8217;t en matière de SEO sous Magento). Celle-ci a d&#8217;ailleurs dépassé le cadre de Magento pour aborder les aspects SEO en général. Il était intéressant d&#8217;apprendre par exemple que la première place sur Google n&#8217;est plus forcément la meilleure. Avec l&#8217;apparition des images dans les résultats des recherches sur Google, les positions autour de celles-ci, deviennent aussi particulièrement intéressantes.</p>
<p>Pour le reste, je pense que les participants ont largement trouvé leur compte et le networking a bien fonctionné. En tout cas, l&#8217;organisation a été remarquable malgré une demi-heure de retard, mais c&#8217;est une constatation très helvétique <img src='http://blog.netinfluence.com/wp-content/plugins/smilies-themer/Silk/emoticon_wink.png' alt=';-)' class='wp-smiley' /> Bref, globalement une très bonne journée !</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.netinfluence.com/2010/05/30/bargento-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>netinfluence recrute … avis aux développeurs qui veulent changer le monde ;-)</title>
		<link>http://blog.netinfluence.com/2010/04/05/netinfluence-recrute-avis-aux-developpeurs-qui-veulent-changer-le-monde/</link>
		<comments>http://blog.netinfluence.com/2010/04/05/netinfluence-recrute-avis-aux-developpeurs-qui-veulent-changer-le-monde/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 21:31:53 +0000</pubDate>
		<dc:creator>sandrine</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[emploi]]></category>
		<category><![CDATA[netinfluence]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[recrutement]]></category>
		<category><![CDATA[typo3]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.netinfluence.ch/?p=1627</guid>
		<description><![CDATA[As-tu la fibre d&#8217;un influenceur?  netinfluence est une agence prometteuse, nouvelle génération, qui réveille un peu le petit monde figé du web et de la communication.  Nous sommes une agence peu ordinaire et si cette annonce t’intéresse, c’est que tu l’es peut être un peu aussi Nous cherchons des développeurs Typo3, PHP/Zend et Cocoa/Objective-C pour agrandir notre équipe. Nous voulons des brutes en développement, des poètes, mais pas seulement.  Si tu te reconnais dans le profil suivant, tu as toutes tes chances pour faire partie de notre équipe, alors n&#8217;hésites pas à suivre les liens pour postuler à la fin de ce billet.  Et si tu connais une personne qui corresponde à ce profil, n&#8217;hésites pas à pousser le message [...]]]></description>
			<content:encoded><![CDATA[<p>As-tu la fibre d&#8217;un influenceur?  netinfluence est une agence prometteuse, nouvelle génération, qui  réveille un peu le petit monde figé du web et de la communication.  Nous sommes une agence peu ordinaire et si cette annonce  t’intéresse, c’est que tu l’es peut être un peu aussi <img src='http://blog.netinfluence.com/wp-content/plugins/smilies-themer/Silk/emoticon_wink.png' alt=';-)' class='wp-smiley' /> </p>
<p>Nous cherchons des développeurs Typo3, PHP/Zend et  Cocoa/Objective-C pour agrandir notre équipe. Nous voulons des brutes en développement, des poètes, mais pas seulement.  Si tu te reconnais dans le profil suivant, tu as toutes tes chances pour faire partie de notre équipe, alors n&#8217;hésites pas à suivre les liens pour postuler à la fin de ce billet.  Et si tu connais une personne qui corresponde à ce profil, n&#8217;hésites pas à pousser le message plus loin.</p>
<p><strong>Profil d&#8217;un influenceur:</strong></p>
<p><strong>Nerdy</strong><br />
Tu penses &#8220;WEB&#8221;, vis web, rêves web. Tu es connecté en permanence sur twitter, facebook, foursquare, netvibes ou google reader et reçois des alertes dès qu&#8217;un nouveau truc sort.  Tu as des comptes beta sur tout et essaie chaque nouveauté pour comprendre.</p>
<p><strong>Curieux</strong><br />
Lorsque tu vois un nouveau site ou une nouvelle app tu cherches à comprendre ce qu&#8217;ils ont fait et comment ils ont fait.  Bouillonnant d&#8217;idées grâce à cette veille permanente que tu partages, tu deviens une source d&#8217;innovation permanente.</p>
<p><strong>Ouvert</strong><br />
Apprendre un nouveau langage ou une nouvelle technique est pour toi un &#8220;Challenge&#8221; et non pas une angoisse.  Tu es résolument tourné vers l&#8217;avenir et pas crispé dès qu&#8217;on te demande d&#8217;envisager une nouvelle façon de faire les choses.</p>
<p><strong>Simple</strong><br />
Tu cherches des réponses à tes problèmes sur Google plutôt que de faire une usine à gaz.  Tu ne cherches pas à réinventer la roue ni à créer ton framework personnel.  Notre job est de faire mieux que ce qui existe, pas d&#8217;inventer l&#8217;eau chaude.  Tu ne perds donc pas ton temps à vouloir recréer tout, mais t&#8217;inspires et améliores, optimises ce qui existe.</p>
<p><strong>Réaliste</strong><br />
La ré-utisabilité c&#8217;est bien, mais qu&#8217;il ne faut pas en faire un dogme.  Parfois on a juste besoin de développer un truc, jetable, pour une seule utilisation.  Souvent on crée des applications ou des sites uniques.  Donc voir plus loin oui, mais ici on &#8220;get real&#8221;.  Ce qui est superflus, est superflus.</p>
<p><strong>Vision Xray</strong><br />
Tu es capable de comprendre les besoins d&#8217;un client, même ceux qu&#8217;il n&#8217;a pas exprimé.  Tu l&#8217;interroges et l&#8217;aide à formuler ses besoins. On ne se contente pas juste de faire ce que l&#8217;on nous demande.  On essaie de comprendre le pourquoi, la vision.  Sans vision on développe ou on crée de mauvaises choses.</p>
<p><strong>Passionné</strong><br />
Si bosser dans l&#8217;urgence ou avec des deadlines très courtes te pose un problème, alors netinfluence n&#8217;est pas pour toi.  Le travaille ne s&#8217;arrête pas à 5h et tu ne débranches pas ton cerveau dès que tu as franchi la porte d&#8217;entrée.  Tu restes connecté non pas par obligation mais par passion.</p>
<p><strong>Travailleur</strong><br />
Quelle que soient les périodes &#8211; intenses ou plus relax &#8211; nous travaillons dur.  Nous donnons tout ce que nous avons pour que notre client soit satisfait.   Et si un projet doit sortir pour respecter toutes les deadlines, on s&#8217;y met tous. On se lève manches et on bosse.  Et comme l&#8217;équipe est composée de pointures, nous sommes naturellement challengés par le niveau élevé d&#8217;exigence des membres de l&#8217;équipe.</p>
<p><strong>Team player</strong><br />
On ne veut ni des divas, ni des egos.  Tu aimes faire partie d&#8217;une équipe et tu t&#8217;impliques pour que l&#8217;équipe soit soudée car tu sais que la somme de nos individualités et de nos expériences est bien supérieure à nos égos.  Chacun apporte son petit grain de folie à cette équipe mais on joue collectif.</p>
<p><strong>L&#8217;envie de changer le monde</strong><br />
Nous ne faisons pas que coder ou designer ou créer des stratégies.  Nous rêvons de changer le monde.  On ne veut pas faire juste ce que l&#8217;on nous demande.  On cherche à créer des concepts qui changeront la vision des autres.  On aime faire des choses qui comptent et pour cela, on doit avoir une vision inspirante.</p>
<p><strong>Goût du challenge</strong><br />
Plus le challenge est complexe et plus nous sommes heureux de le relever.  Le mot d&#8217;ordre dans l&#8217;équipe est &#8220;user experience&#8221;.  Pour nous, la technologie, le design doivent être asservis à l&#8217;utilisateur et non le contraire.  Hors c&#8217;est souvent un défi de faire ce que nous voulons.  Une chose est impossible jusqu&#8217;à ce qu&#8217;une personne y parvienne.  Relever les défis nous motive car nous poussons plus loin que autres, pour que le site ou l&#8217;application soit une réussite en matière de usability</p>
<p><strong>200%</strong><br />
Tu ne t&#8217;économise pas à la tâche.  Ce qui compte c&#8217;est de te dépasser, de relever des défis de faire mieux aujourd&#8217;hui qu&#8217;hier.  Tu as un niveau d&#8217;exigence très élevé envers toi même et ne tolères pas la médiocrité.  Mais attention, tu ne confond pas exigence et perfectionnisme, car la perfection est un leurre.  Dans un monde comme le web qui change chaque 24h, la perfection est un faux ami.</p>
<blockquote><p>Si tu souhaites rejoindre notre équipe tu peux postuler sur profession-web.ch :</p>
<blockquote>
<li>Postuler au poste d&#8217;expert <a title="Postuler" href="http://www.profession-web.ch/annonces/143/szabo/expert_phpmysql_zend/" target="_blank">PHP / Zend</a></li>
<li>Postuler au poste d&#8217;expert <a title="Postuler" href="http://www.profession-web.ch/annonces/144/szabo/expert_typo3/" target="_blank">Typo3</a></li>
<li>Postuler au poste d&#8217;expert <a title="Postuler" href="http://www.profession-web.ch/annonces/142/szabo/expert_cocoa_objective_c_iphoneipad/" target="_blank">Objective-C / Cocoa</a></li>
</blockquote>
</blockquote>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.netinfluence.com/2010/04/05/netinfluence-recrute-avis-aux-developpeurs-qui-veulent-changer-le-monde/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TYPO3 et Campaign Monitor</title>
		<link>http://blog.netinfluence.com/2010/01/04/typo3-et-campaign-monitor/</link>
		<comments>http://blog.netinfluence.com/2010/01/04/typo3-et-campaign-monitor/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 15:01:23 +0000</pubDate>
		<dc:creator>macmade</dc:creator>
				<category><![CDATA[create]]></category>
		<category><![CDATA[Développement]]></category>
		<category><![CDATA[newsletter]]></category>
		<category><![CDATA[Online PR & communication]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[typo3]]></category>

		<guid isPermaLink="false">http://blog.netinfluence.ch/?p=522</guid>
		<description><![CDATA[Pour les utilisateurs du CMS TYPO3 et du service Campaign Monitor, netinfluence vient de publier une extension TYPO3 permettant l'enregistrement d'une adresse email dans une liste gérée par Campaign Monitor depuis le frontend TYPO3.]]></description>
			<content:encoded><![CDATA[<div>Pour les utilisateurs du CMS <a href="http://typo3.org/">TYPO3</a> et du service <a href="http://www.campaignmonitor.com/">Campaign Monitor</a>, netinfluence vient de publier une extension TYPO3 permettant l&#8217;enregistrement d&#8217;une adresse email dans une liste gérée par Campaign Monitor depuis le frontend TYPO3.</p>
<p>Cette extension peut-être <a href="http://typo3.org/extensions/repository/view/netmailing/current/">téléchargée</a> depuis le site officiel de TYPO3.</p>
<p>La <a href="http://typo3.org/documentation/document-library/extension-manuals/netmailing/1.0.0/view/">documentation</a> est également disponible directement en ligne.</p>
</div>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.netinfluence.com/2010/01/04/typo3-et-campaign-monitor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog en ZF – étape 3 : Utilisation du Zend_Layout pour le template</title>
		<link>http://blog.netinfluence.com/2009/09/11/blog-en-zf-etape-3-utilisation-du-zend_layout-pour-le-template/</link>
		<comments>http://blog.netinfluence.com/2009/09/11/blog-en-zf-etape-3-utilisation-du-zend_layout-pour-le-template/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 20:13:00 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[create]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[tutoriel]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.netinfluence.ch/?p=52</guid>
		<description><![CDATA[Notre blog affiche bien notre contenu, mais on doit actuellement coder notre code HTML dans chaque vue. A ce stade, on pourrait s&#8217;en contenter, mais comme nous allons avoir plusieurs pages, cela n&#8217;est pas viable. Il nous faut donc un template. La création du template nous permettra de ne pas répéter le code pour chaque nouveau contenu et de changer notre mise en plage simplement en modifiant un seul fichier. La solution existe : le Zend_Layout. Pour cet exemple, j&#8217;ai préparé un fichier Zip, contenant un template html. Je me suis inspiré du site www.alsacreations.com, qui vous propose plusieurs modèles prêts à l&#8217;emploi. Vous pouvez accéder à tous les templates d&#8217;alsacréations sur cette page : http://www.alsacreations.com/static/gabarits/liste.html. Le fichier Zip que je vous [...]]]></description>
			<content:encoded><![CDATA[<p>Notre blog affiche bien notre contenu, mais on doit actuellement coder notre code HTML dans chaque vue. A ce stade, on pourrait s&#8217;en contenter, mais comme nous allons avoir plusieurs pages, cela n&#8217;est pas viable. Il nous faut donc un template.  La création du template nous permettra de ne pas répéter le code pour chaque nouveau contenu et de changer notre mise en plage simplement en modifiant un seul fichier.</p>
<p>La solution existe : le <strong>Zend_Layout</strong>.</p>
<p>Pour cet exemple, j&#8217;ai préparé un fichier Zip, contenant un template html. Je me suis inspiré du site <a href="http://www.alsacreations.com/static/gabarits/liste.html">www.alsacreations.com</a>, qui vous propose plusieurs modèles prêts à l&#8217;emploi. Vous pouvez accéder à tous les templates d&#8217;alsacréations sur cette page : <a href="http://www.alsacreations.com/static/gabarits/liste.html">http://www.alsacreations.com/static/gabarits/liste.html</a>.</p>
<p><a href="/public/jean/tuto_zf/_article_3.zip">Le fichier Zip que je vous ai préparé et que vous pouvez télécharger ici</a>, contient donc un fichier phtml, et 2 fichiers CSS.</p>
<h2>1. Mise en place des fichiers :</h2>
<p>Dans le répertoire public, créer un répertoire <strong>css</strong> et y déposer les 2 fichiers Css.</p>
<p>Dans le répertoire application, créer le répertoire <strong>layouts</strong> et <strong>scripts</strong>. copier le fichier layout.phtml.</p>
<p>Par défaut, le Zend_Layout utilisera ce fichier pour rendre nos vues.</p>
<h2>2. Configurer le Zend_Layout</h2>
<p>Ajouter le code suivant dans application/configs/application.ini :</p>
<pre class="brush:php">resources.layout.layoutPath = APPLICATION_PATH . "/layouts/scripts"
resources.view[] =
resources.view.encoding = "UTF-8"</pre>
<p>Dans le fichier template, vous trouverez ce code :</p>
<pre class="brush:html">
<div id="contenu">
    content; ?&gt;</div>
</pre>
<p>Cela permet de rendre le contenu de notre vue à cette endroit.</p>
<h2>3. Modifier notre fichier de vue</h2>
<p>Nous pouvons maintenant supprimer de ce fichier (application/views/scripts/index/index.phtml) tout le code html de la page, et ne garder que ceci :</p>
<pre class="brush: php">url(array('controller'=&gt;'articles', 'action' =&gt;'detail', 'id'=&gt;$row-&gt;art_id ));
?&gt;</pre>
<pre lang="enc__php">entries AS $row) {
$lien = $this-&gt;url(array('controller'=&gt;'articles', 'action' =&gt; 'detail', 'id'=&gt;$row-&gt;art_id ));
?&gt;
<div class="article">
<h2><a href="&lt;?= $lien; ?&gt;">art_titre; ?&gt;</a></h2>

<span class="date">art_date; ?&gt; </span>

art_chapeau ?&gt;</div>
</pre>
<pre class="brush: php">entries AS $row) {
$lien = $this-&gt;url(array('controller'=&gt;'articles', 'action' =&gt; 'detail', 'id'=&gt;$row-&gt;art_id ));
?&gt;
<div class="»article">
<h2><a href="&lt;?= $lien; ?&gt;">art_titre; ?&gt;</a></h2>

<span class="date">art_date; ?&gt; </span>

art_chapeau ?&gt;</div>
</pre>
<blockquote>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #000000; font-weight: bold;">&lt;?php</span></div>
<p><span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="color: #b1b100;">foreach</span><span style="color: #009900;">(</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">entries</span> <span style="color: #b1b100;">AS</span> <span style="color: #000088;">$row</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span></span></p>
<p><span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="color: #000088;">$lien</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #009900;">(</span><span style="color: #990000;">array</span><span style="color: #009900;">(</span><span>&#8216;controller&#8217;</span><span style="color: #339933;">=&gt;</span><span>&#8216;articles&#8217;</span><span style="color: #339933;">,</span> <span>&#8216;action&#8217;</span> <span style="color: #339933;">=&gt;</span> <span>&#8216;detail&#8217;</span><span style="color: #339933;">,</span> <span>&#8216;id&#8217;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_id</span> <span style="color: #009900;">)</span><span style="color: #009900;">)</span>;</span><br />
<strong>?&gt;</strong><br />
<span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;">&lt;div class=&#8221;article&#8221;&gt;</span><br />
<span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;">&lt;h2&gt;&lt;a href=&#8221;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$lien</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&#8220;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_titre</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;</span></p>
<p><span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;">&lt;span class=&#8221;date&#8221;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_date</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/span&gt;</span></p>
<p><span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;">&lt;p class=&#8221;chapeau&#8221;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_chapeau</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/p&gt;</span><br />
<span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;">&lt;/div&gt;</span><br />
<strong>&lt;?php</strong><br />
<span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif; color: #009900;">}</span><br />
<strong>?&gt;</strong></p></blockquote>
<p>Il faut faire la même chose pour le fichier de détail (application/views/scripts/articles/detail.phtml) :</p>
<blockquote><p><span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;">&lt;div class=&#8221;article_detail&#8221;&gt;</span></p>
<p><span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;">&lt;h1&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_titre</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h1&gt;</span></p>
<p><span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;">&lt;span class=&#8221;date&#8221;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_date</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/span&gt;</span><br />
<span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;">&lt;p class=&#8221;chapeau&#8221;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_chapeau</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/p&gt;</span><br />
<span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;">&lt;p class=&#8221;corps&#8221;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_contenu</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/p&gt;</span><br />
<span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;">&lt;/div&gt;</span></p></blockquote>
<h2>4. Rendons ces menus dynamiques</h2>
<p>Dans le template, vous pouvez trouver ce code :</p>
<blockquote><p><span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;">&lt;div id=&#8221;navigation&#8221;&gt;</span><br />
<span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">action</span><span style="color: #009900;">(</span><span>&#8216;index&#8217;</span><span style="color: #339933;">,</span> <span>&#8216;menu&#8217;</span><span style="color: #009900;">)</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">action</span><span style="color: #009900;">(</span><span>&#8216;categories&#8217;</span><span style="color: #339933;">,</span> <span>&#8216;menu&#8217;</span><span style="color: #009900;">)</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></span></p>
<p><span style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="color: #000000; font-weight: bold;"><span style="font-weight: normal;">&lt;/div&gt;</span></span></span></p></blockquote>
<p>Comme ces menus sont amenés à être modifié et dynamique pour les catégories, nous allons utiliser un controleur menu et 2 actions :  index et categories.</p>
<p>Exécuter ces commandes à la racine du blog, en ligne de commande :</p>
<pre class="php php" style="font-family: inherit;">zf create controller menu
zf create action categories menu</pre>
<blockquote><p>zf create controller menu<br />
zf create action categories menu</p></blockquote>
<p>Pour cette exemple, nous allons laisser du code html dans ces 2 vues, mais nous les modifierons plus tard pour les rendre dynamique, notamment pour afficher la liste des catégories.</p>
<p>Dans /application/views/scripts/menu/index.phtml, ajoutez ce code :</p>
<blockquote>
<div id="_mcePaste">&lt;ul&gt;</div>
<div id="_mcePaste">&lt;li&gt;&lt;a href=&#8221;/&#8221;&gt;Accueil&lt;/a&gt;&lt;/li&gt;</div>
<div id="_mcePaste">&lt;li&gt;&lt;a href=&#8221;/auteurs/&#8221;&gt;Auteurs&lt;/a&gt;&lt;/li&gt;</div>
<div id="_mcePaste">&lt;li&gt;&lt;a href=&#8221;/historique/&#8221;&gt;Historique&lt;/a&gt;&lt;/li&gt;</div>
<div id="_mcePaste">&lt;/ul&gt;</div>
</blockquote>
<p>et dans /application/views/scripts/menu/categories.phtml :</p>
<pre class="php php" style="font-family: inherit;">
<ol>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Catégories<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #339933;">&lt;</span>ul<span style="color: #339933;">&gt;</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">"/categorie/1/"</span><span style="color: #339933;">&gt;</span>Catégorie <span style="color: #cc66cc;">1</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">"/categorie/2/"</span><span style="color: #339933;">&gt;</span>Catégorie <span style="color: #cc66cc;">2</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">"/categorie/3/"</span><span style="color: #339933;">&gt;</span>Catégorie <span style="color: #cc66cc;">3</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">"/categorie/4/"</span><span style="color: #339933;">&gt;</span>Catégorie <span style="color: #cc66cc;">4</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	<span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">"/categorie/5/"</span><span style="color: #339933;">&gt;</span>Catégorie <span style="color: #cc66cc;">5</span><span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #339933;">&lt;/</span>ul<span style="color: #339933;">&gt;</span></div>
</li>
</ol>
</pre>
<h2>5. Résultat</h2>
<p>Retournons maintenant sur notre page index, et observons le résultat :</p>
<p><img style="display: block; margin: 0 auto;" title="screenshot_home.png, sept. 2009" src="/public/jean/tuto_zf/.screenshot_home_m.jpg" alt="screenshot_home.png" /></p>
<p>c&#8217;est quand même plus sympa, non ?</p>
<h3>A voir ou revoir :</h3>
<ul>
<li>Article 1 : <a href="/post/2009/05/23/Un-blog-en-Zend-Framework-Etape-1-Zend-Tool">Mise en place et Zend_Tool</a></li>
<li>Article 2 : <a href="/post/2009/08/25/Blog-en-ZF-etape-2-La-base-de-donnees-et-le-premier-affichage">La base de données</a></li>
</ul>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.netinfluence.com/2009/09/11/blog-en-zf-etape-3-utilisation-du-zend_layout-pour-le-template/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Blog en ZF – étape 2 : La base de données et le premier affichage</title>
		<link>http://blog.netinfluence.com/2009/08/25/blog-en-zf-etape-2-la-base-de-donnees-et-le-premier-affichage/</link>
		<comments>http://blog.netinfluence.com/2009/08/25/blog-en-zf-etape-2-la-base-de-donnees-et-le-premier-affichage/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 21:27:00 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[create]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tutoriel]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.netinfluence.ch/?p=51</guid>
		<description><![CDATA[Après avoir installé correctement notre Zend Framework, nous allons passer du coté de la base de données. Pour mettre en place notre blog, nous allons commencé par créer 4 tables : Table &#8220;Articles&#8221; Un article sera composé d&#8217;un titre, d&#8217;un chapeau, du texte en lui-même, la date, l&#8217;auteur et un flag indiquant que l&#8217;article est en ligne. Table &#8220;Categories&#8221; Cette table contient le nom de la catégorie, et un nom d&#8217;url propre. La catégorie &#8220;Zend FrameWork&#8221; aura l&#8217;url zend_framework. Table &#8220;Auteurs&#8221; le nom, le prénom, l&#8217;email de l&#8217;auteur, ainsi qu&#8217;un champ url pour avoir des url propre. Table &#8220;Commentaires&#8221; Les commentaires à nos articles, avec le nom, l&#8217;email, le commentaire en lui même, la date et un champ de validation pour [...]]]></description>
			<content:encoded><![CDATA[<p>Après avoir installé correctement notre Zend Framework, nous allons passer du coté de la base de données.</p>
<p>Pour mettre en place notre blog, nous allons commencé par créer 4 tables :</p>
<p><strong>Table &#8220;Articles&#8221;</strong><br />
Un article sera composé d&#8217;un titre, d&#8217;un chapeau, du texte en lui-même, la date, l&#8217;auteur et un flag indiquant que l&#8217;article est en ligne.</p>
<p><strong>Table &#8220;Categories&#8221;</strong><br />
Cette table contient le nom de la catégorie, et un nom d&#8217;url propre. La catégorie &#8220;Zend FrameWork&#8221; aura l&#8217;url zend_framework.</p>
<p><strong>Table &#8220;Auteurs&#8221;</strong><br />
le nom, le prénom, l&#8217;email de l&#8217;auteur, ainsi qu&#8217;un champ url pour avoir des url propre.</p>
<p><strong>Table &#8220;Commentaires&#8221;</strong><br />
Les commentaires à nos articles, avec le nom, l&#8217;email, le commentaire en lui même, la date et un champ de validation pour permettre la modération de nos commentaires</p>
<p>Voici le schéma de notre base de données. <img style="display: block; margin: 0 auto;" title="MCD Blog, août 2009" src="/public/jean/tuto_zf/mcd_blog.png" alt="MCD Blog" /> Celle ci est volontairement simplifiée, mais suffisamment complète pour voir les différents aspects du Framework.</p>
<p>Je vous laisse mettre votre propre contenu pour vos tests. Voici un fichier pour créer cette base, et aussi mettre du contenu pour commencer. <a href="/public/jean/tuto_zf/blog_sql.zip">Le fichier sql.</a></p>
<p>Maintenant que notre base est mise en place, avec du contenu pour faire nos premiers tests, il est temps de passer au choses sérieuses : l&#8217;affichage de nos articles.</p>
<h3>1- Configuration de l&#8217;accès MySql</h3>
<p>Editer votre fichier <em>application/configs/application.ini</em></p>
<p>Après la ligne : resources.frontController.controllerDirectory = APPLICATION_PATH &#8220;/controllers&#8221;</p>
<p>Ajouter le code suivant :</p>
<p>[php]<br />
// Connexion a la base de donnees<br />
resources.db.adapter = &quot;pdo_mysql&quot;<br />
resources.db.params.host = &quot;localhost&quot;<br />
resources.db.params.username = &quot;root&quot;<br />
resources.db.params.password = &quot;password&quot;<br />
resources.db.params.dbname = &quot;blog&quot;<br />
resources.db.params.driver_options.1002 = &quot;SET NAMES utf8&quot;<br />
resources.db.isDefaultTableAdapter = true<br />
[/php]</p>
<p>Cela va indiquer au Zend FrameWork que nous allons nous connecter à la base &#8220;blog&#8221; avec le user &#8220;root&#8221;, via une connexion &#8220;PDO&#8221;.</p>
<pre class="php php" style="font-family: inherit;">
<ol>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">resources<span style="color: #339933;">.</span>db<span style="color: #339933;">.</span>params<span style="color: #339933;">.</span>driver_options<span style="color: #339933;">.</span>1002 <span style="color: #339933;">=</span> <span style="color: #0000ff;">"SET NAMES utf8"</span></div>
</li>
</ol>
</pre>
<p>Cette ligne va nous permettre de gérer correctement le contenu Utf8.</p>
<p>La dernière ligne nous permet d&#8217;indiquer qu&#8217;il s&#8217;agit de notre adaptateur par défaut. Comme nous n&#8217;avons qu&#8217;une seule base de données, cela nous éviteras de spécifier le connecteur.</p>
<h3>2 &#8211; Autoloader</h3>
<p>Dans le fichier Bootstrap.php, il faut configurer notre autoloader, pour que ZendFrameWork trouve nos classes tout seul.</p>
<p>Ajouter la méthode _initAutoload() comme cela :</p>
<pre class="php php" style="font-family: inherit;">
<ol>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #000000; font-weight: bold;">&lt;?php</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #000000; font-weight: bold;">class</span> Bootstrap <span style="color: #000000; font-weight: bold;">extends</span> Zend_Application_Bootstrap_Bootstrap</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #009900;">{</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	protected <span style="color: #000000; font-weight: bold;">function</span> _initAutoload<span style="color: #009900;">(</span><span style="color: #009900;">)</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    <span style="color: #009900;">{</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    	<span style="color: #000088;">$autoloader</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Application_Module_Autoloader<span style="color: #009900;">(</span><span style="color: #990000;">array</span><span style="color: #009900;">(</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">            <span>'namespace'</span> <span style="color: #339933;">=&gt;</span> <span>''</span><span style="color: #339933;">,</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">            <span>'basePath'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">(</span><span style="color: #000000; font-weight: bold;">__FILE__</span><span style="color: #009900;">)</span><span style="color: #339933;">,</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        <span style="color: #009900;">)</span><span style="color: #009900;">)</span>;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$autoloader</span>;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    <span style="color: #009900;">}</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #009900;">}</span></div>
</li>
</ol>
</pre>
<h3>3 &#8211; Db Oject pour Articles</h3>
<p>Afin d&#8217;accéder à nos contenus, nous allons créer des classes qui vont étendre le Zend_Db_Table_Abstract. Cet objet nous permet d&#8217;accéder facilement à notre table en nous fournissant des méthodes standards pour effectuer des recherches ou update.</p>
<p>La première classe sera la classe Articles.</p>
<p>Dans le répertoires models/DbTable ( créer le répertoire s&#8217;il n&#8217;existe pas), nous créons la classe <strong>Articles.php</strong></p>
<p>Le contenu de cette classe :</p>
<pre class="php php" style="font-family: inherit;">
<ol>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #000000; font-weight: bold;">&lt;?php</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #0000ff; font-style: italic;">/**</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #0000ff; font-style: italic;"> * This is the DbTable class for the artices table.</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #0000ff; font-style: italic;"> */</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #000000; font-weight: bold;">class</span> Model_DbTable_Articles <span style="color: #000000; font-weight: bold;">extends</span> Zend_Db_Table_Abstract</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #009900;">{</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    <span style="color: #0000ff; font-style: italic;">/** Table name */</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    protected <span style="color: #000088;">$_name</span>    <span style="color: #339933;">=</span> <span>'articles'</span>;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    protected <span style="color: #000088;">$_primary</span> <span style="color: #339933;">=</span> <span>'art_id'</span>;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #009900;">}</span></div>
</li>
</ol>
</pre>
<p>Comme vous pouvez le constater, cette classe est très simple. On définit simplement le nom de la table et le nom de notre clé primaire.</p>
<h3>4 &#8211; Afficher la liste des articles</h3>
<p>Il est temps d&#8217;afficher la liste de nos articles sur notre page d&#8217;acceuil.</p>
<p>La première chose à faire est de modifier notre controller &#8220;indexController.php&#8221;</p>
<pre class="php php" style="font-family: inherit;">
<ol>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> indexAction<span style="color: #009900;">(</span><span style="color: #009900;">)</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    <span style="color: #009900;">{</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        <span style="color: #666666; font-style: italic;">// action body</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">       	<span style="color: #000088;">$articles</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Model_DbTable_Articles<span style="color: #009900;">(</span><span style="color: #009900;">)</span>;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"> 		<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;">entries</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$articles</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetchAll</span><span style="color: #009900;">(</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"> 										<span style="color: #000088;">$articles</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">select</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"> 										<span style="color: #339933;">-&gt;</span><span style="color: #004000;">where</span><span style="color: #009900;">(</span><span>'art_en_ligne = ?'</span><span style="color: #339933;">,</span> <span>'1'</span><span style="color: #009900;">)</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">                                        <span style="color: #339933;">-&gt;</span><span style="color: #004000;">order</span><span style="color: #009900;">(</span><span>'art_date DESC'</span><span style="color: #009900;">)</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">                                        <span style="color: #339933;">-&gt;</span><span style="color: #004000;">limit</span><span style="color: #009900;">(</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #800080;">0</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span>;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    <span style="color: #009900;">}</span></div>
</li>
</ol>
</pre>
<p>Nous indiquons ici que nous recherchons les articles en ligne, par date de publication. J&#8217;ai pris ici la méthode préconisé dans la documentation, en utilisant l&#8217;objet &#8220;select&#8221;.</p>
<p>Il nous reste plus qu&#8217;à mettre en forme cette affichage dans le fichier <em>application/views/scripts/index/index.phtml</em>. Ce fichier est notre Vue, le V du MVC. Remplacer le contenu de ce fichier par :</p>
<pre class="php php" style="font-family: inherit;">
<ol>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">&lt;style&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">h2</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    {</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	    color: #91BE3F;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    		margin: 20px 0 10px 0;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    }</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	h2 a</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	    {</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	        color: #91BE3F;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	}</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    div.article</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    {</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        color: #000;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        width:  600px;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        border-bottom: 1px solid #444444;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    }</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	span.date {</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	   color: #000;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">		font-size: 12px;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	}</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">&lt;/style&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">&lt;div id="welcome"&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    &lt;h1&gt;Bienvenue sur notre Blog&lt;/h1&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">&lt;/div&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #000000; font-weight: bold;">&lt;?php</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #b1b100;">foreach</span><span style="color: #009900;">(</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">entries</span> <span style="color: #b1b100;">AS</span> <span style="color: #000088;">$row</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #000000; font-weight: bold;">?&gt;</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	&lt;div class="article"&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">		&lt;h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_titre</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h2&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">		&lt;span class="date"&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_date</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/span&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">		&lt;p class="chapeau"&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_chapeau</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/p&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	&lt;/div&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #000000; font-weight: bold;">&lt;?php</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #009900;">}</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #000000; font-weight: bold;">?&gt;</span></div>
</li>
</ol>
</pre>
<p>Nous pouvons maintenant voir notre résultat en rafraichissant notre navigateur :</p>
<p><img style="display: block; margin: 0 auto;" title="Index du blog, août 2009" src="/public/jean/tuto_zf/resultat_index_blog.jpg" alt="Index du blog" /></p>
<p>Simple non ?</p>
<h3>5 &#8211; Faire un lien sur le détail d&#8217;un article.</h3>
<p>Nous n&#8217;allons pas nous arrêter en aussi bon chemin, nous allons faire un lien sur le titre de nos articles pour afficher le détail de celui ci.</p>
<p>Dans notre boucle d&#8217;affichage, ajoutons un lien sur le controller articles et sur l&#8217;action detail, en passant le parametre id, contenant l&#8217;id de l&#8217;article à afficher.</p>
<pre class="php php" style="font-family: inherit;">
<ol>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">foreach($this-&gt;entries AS $row) {</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	$lien =  $this-&gt;url(array('controller'=&gt;'articles', 'action' =&gt; 'detail', 'id'=&gt;$row-&gt;art_id ));</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">?&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	&lt;div class="article"&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">		&lt;h2&gt;&lt;a href="<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$lien</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>"&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_titre</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">		&lt;span class="date"&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_date</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/span&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">		&lt;p class="chapeau"&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_chapeau</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/p&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	&lt;/div&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #000000; font-weight: bold;">&lt;?php</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #009900;">}</span></div>
</li>
</ol>
</pre>
<h2>6 &#8211; Afficher le detail de l&#8217;article</h2>
<p>Dans le controlleur :<em> /application/controllers/ArticlesControllers</em>, nous ajoutons ceci à la méthode &#8220;detailAction&#8221;, afin de rechercher le detail d&#8217;un article en ligne :</p>
<pre class="php php" style="font-family: inherit;">
<ol>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> detailAction<span style="color: #009900;">(</span><span style="color: #009900;">)</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    <span style="color: #009900;">{</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">       <span style="color: #666666; font-style: italic;">// Id of the Farm</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        <span style="color: #000088;">$articleId</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRequest</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getParam</span><span style="color: #009900;">(</span><span>'id'</span><span style="color: #009900;">)</span>;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        <span style="color: #b1b100;">if</span> <span style="color: #009900;">(</span><span style="color: #000088;">$articleId</span> <span style="color: #339933;">!=</span> <span>''</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        	<span style="color: #000088;">$articles</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Model_DbTable_Articles<span style="color: #009900;">(</span><span style="color: #009900;">)</span>;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"> 			<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;">data</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$articles</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetchRow</span><span style="color: #009900;">(</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"> 										<span style="color: #000088;">$articles</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">select</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"> 										<span style="color: #339933;">-&gt;</span><span style="color: #004000;">where</span><span style="color: #009900;">(</span><span>'art_en_ligne = ?'</span><span style="color: #339933;">,</span> <span>'1'</span><span style="color: #009900;">)</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;"> 										<span style="color: #339933;">-&gt;</span><span style="color: #004000;">where</span><span style="color: #009900;">(</span><span>'art_id = ?'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$articleId</span><span style="color: #009900;">)</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">										<span style="color: #009900;">)</span>;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        <span style="color: #009900;">}</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">{</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">            <span style="color: #000088;">$articleId</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">null</span>;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        <span style="color: #009900;">}</span></div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    <span style="color: #009900;">}</span></div>
</li>
</ol>
</pre>
<p>et dans le fichier application/views/scripts/articles/detail.phtml :</p>
<pre class="php php" style="font-family: inherit;">
<ol>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">&lt;style&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    h1</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    {</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        color: #91BE3F;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    	margin: 20px 0 10px 0;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    }</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    div.article_detail</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    {</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        color: #000;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        width:  600px;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">        border-bottom: 1px solid #444444;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    }</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    p.chapeau {</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">    	font-style: italic;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	}</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	span.date {</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	    color: #000;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	    font-size: 12px;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	}</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">&lt;/style&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">&lt;div class="article_detail"&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	&lt;h1&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_titre</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h1&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	&lt;span class="date"&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_date</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/span&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	&lt;p class="chapeau"&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_chapeau</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/p&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">	&lt;p class="corps"&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">art_contenu</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/p&gt;</div>
</li>
<li>
<div style="font-family: monospace; font-weight: normal; font-style: normal; margin: 0; padding: 0; background: inherit;">&lt;/div&gt;</div>
</li>
</ol>
</pre>
<p>Si nous cliquons sur le titre de notre article, nous nous retrouvons maintenant sur le détail de l&#8217;article.</p>
<h3>La suite&#8230;</h3>
<p>Dans le prochain article, nous allons voir les points suivants :</p>
<ul>
<li>La mise en forme avec le Zend Layout</li>
<li>Les liaisons entre nos tables, via le ZendDb</li>
<li>Les formulaires</li>
<li>La gestion des droits avec les ACLs pour la partie administration.</li>
<li>Personnaliser et mettre en place le routing des urls.</li>
</ul>
<p>N&#8217;hésitez pas à me dire si vous voulez aborder certains points en particulier.</p>
<h3>A voir ou revoir :</h3>
<ul>
<li>Article 1 : <a href="/post/2009/05/23/Un-blog-en-Zend-Framework-Etape-1-Zend-Tool">Mise en place et Zend_Tool</a></li>
<li>Article 3 : <a href="/post/2009/09/11/Blog-en-ZF-etape-3-Utilisation-du-Zend_Layout-pour-le-template">Zend_Layout et template</a></li>
</ul>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.netinfluence.com/2009/08/25/blog-en-zf-etape-2-la-base-de-donnees-et-le-premier-affichage/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>__toString method is not so magic before PHP 5.2!</title>
		<link>http://blog.netinfluence.com/2009/08/14/__tostring-is-not-so-magic-before-php-5-2/</link>
		<comments>http://blog.netinfluence.com/2009/08/14/__tostring-is-not-so-magic-before-php-5-2/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 14:07:00 +0000</pubDate>
		<dc:creator>netinfluence</dc:creator>
				<category><![CDATA[create]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.netinfluence.ch/?p=49</guid>
		<description><![CDATA[This article was originally created by Emilien Vuillaume (Left our team) With Object Oriented Programmation, it is often useful to display an object quickly and easily. The PHP langage has a magic object method to do that : class Object{    public function __toString()    {    }} This method, if it is defined, will be automatically called (magic !) when the Object is displayed. It&#8217;s nice, no ? But if your Php version is prior to 5.2, the magic method is not called ! Example : class Car{    public $color;     public function __construct($color = 'white')    {       $this-&#62;color = $color;    }     public function __toString()    {        return $this-&#62;color . ' car';    }} $Car    = new Car();$redCar = new Car('red'); echo "There is a " . $Car [...]]]></description>
			<content:encoded><![CDATA[<p style="color: #999999; border-bottom: solid 1px #EFEFEF; margin-bottom: 20px; padding-bottom: 20px;">This article was originally created by Emilien Vuillaume (Left our team)</p>
<p>With Object Oriented Programmation, it is often useful to display an object quickly and easily.<br />
The <a hreflang="en" href="www.php.net">PHP langage</a> has a magic object method to do that :</p>
<pre>class Object{    public function __toString()    {    }}</pre>
<p>This method, if it is defined, will be automatically called (magic !) when the Object is displayed.<br />
It&#8217;s nice, no ? But if your Php version is prior to 5.2, the magic method is not called !</p>
<p>Example :</p>
<pre>class Car{    public $color;

    public function __construct($color = 'white')    {       $this-&gt;color = $color;    }

    public function __toString()    {        return $this-&gt;color . ' car';    }}

$Car    = new Car();$redCar = new Car('red');

echo "There is a " . $Car . " and a " . $redCar;</pre>
<p>In Php 5.2.1 :</p>
<pre>There is a white car and a red car</pre>
<p>But with Php before 5.2 :</p>
<pre>There is a <span style="color: red;">Object #1</span> and a <span style="color: red;">Object #2</span></pre>
<p>So, to be sure of the behavior of your script, you can call directly the __toString() method.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.netinfluence.com/2009/08/14/__tostring-is-not-so-magic-before-php-5-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Comment et pourquoi se préparer pour la certification Zend Framework</title>
		<link>http://blog.netinfluence.com/2009/05/28/certification-zend-framework/</link>
		<comments>http://blog.netinfluence.com/2009/05/28/certification-zend-framework/#comments</comments>
		<pubDate>Thu, 28 May 2009 13:08:00 +0000</pubDate>
		<dc:creator>netinfluence</dc:creator>
				<category><![CDATA[care]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.netinfluence.ch/?p=44</guid>
		<description><![CDATA[This article was originally created by Emilien Vuillaume (Left our team) Développé par Zend et supporté par une communauté très importante de développeur, Zend framework est actuellement considéré comme le framework PHP le plus abouti dans les développements Open Source. Apportant une véritable reconnaissance technique, la réussite de la certification ZF permet a la personne titulaire de se positionner comme spécialiste et à apporter aux clients de l&#8217;entreprise un support technique de qualité. Basé sur PHP5, le Zend Framework répond a tous les besoins d&#8217;un développement Web modern : model MVC, Abstraction SGBD, utilisation native des principaux webservices, etc&#8230; La certification Contrairement à la certification php5 qui porte sur les bases du langage, la certification ZF quant à elle, repose [...]]]></description>
			<content:encoded><![CDATA[<p style="color: #999999; border-bottom: solid 1px #EFEFEF; margin-bottom: 20px; padding-bottom: 20px;">This article was originally created by Emilien Vuillaume (Left our team)</p>
<p><strong></strong>Développé par Zend et supporté par une communauté très importante de développeur,  Zend framework est actuellement considéré comme le framework PHP le plus abouti dans les développements Open Source.<br />
Apportant une véritable reconnaissance technique, la réussite de la certification ZF permet a la personne titulaire de se positionner comme spécialiste et à apporter aux clients de l&#8217;entreprise un support technique de qualité.<br />
Basé sur PHP5, le Zend Framework répond a tous les besoins d&#8217;un développement Web modern : model MVC, Abstraction SGBD, utilisation native des principaux webservices, etc&#8230;</p>
<p><strong>La certification</strong><br />
Contrairement à la certification php5 qui porte sur les bases du langage, la <a href="http://www.zend.com/fr/services/certification/framework/">certification ZF</a> quant à elle, repose sur une connaissance précise et approfondie des éléments du framework : principe, configuration, utilisation.</p>
<p><strong>La préparation à la certification ZFCE</strong><br />
Ma préparation a l&#8217;examen s&#8217;est déroulé en 2 étapes.<br />
Lors de sa sortie, j&#8217;ai tout d&#8217;abord essayé de migrer des développements PHP existants en Zend Framework. Rapidement je me suis aperçu de la complexité de ce Framework mais aussi de sa souplesse d&#8217;utilisation. Partant de ce constat, j&#8217;ai décidé de me plonger dans un guide afin d&#8217;en cerner les moindres détails.<br />
Je conseille grandement de toujours se baser un ou des exemples concrets. Il est en effet illusoire de penser réussir ce genre de certification en lisant simplement tel ou tel livre ou PDF.</p>
<p>Voici les deux principaux ouvrages qui mon servi lors de mes revisions :<br />
- <a href="http://www.manning.com/allen/">Zend Framework In Action</a> : Ce livre couvre les principaux outils offert par le ZF avec des exemples de code. A lire en complement de la documentation en ligne du zend framework.<br />
- <a href="http://www.zend.com/community/downloads">Zend Framework Certification &#8211; Study Guide</a> : Présentation en 14 chapitres des connaissances a acquérir pour réussir l&#8217;examen<br />
- Site web ou forum : <a href="http://www.z-f.fr/">Communauté francophone du Zend Framework</a>,<a href="http://framework.zend.com/manual/fr/"> Manuel Zend Framework</a>, <a href="http://framework.zend.com/">Site officiel du Zend Framework</a>.</p>
<p><em>Image used under Creative Commons from <a href="http://www.flickr.com/photos/musicdance-sfsu-edu/3520090881/" target="_blank">musicdance.sfsu</a></em></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.netinfluence.com/2009/05/28/certification-zend-framework/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Un blog en Zend Framework : Etape 1 =&gt; Zend Tool</title>
		<link>http://blog.netinfluence.com/2009/05/24/un-blog-en-zend-framework-etape-1-zend-tool/</link>
		<comments>http://blog.netinfluence.com/2009/05/24/un-blog-en-zend-framework-etape-1-zend-tool/#comments</comments>
		<pubDate>Sun, 24 May 2009 21:15:00 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[create]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tutoriel]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.netinfluence.ch/?p=43</guid>
		<description><![CDATA[Le Zend Framework, depuis sa version 1.8, a apporté une nouvelle fonctionnalité, le ZendTool. Cela permet de nous aider dans la mise en route d&#8217;un projet Zend Framework. Pour cette série d&#8217;article, je vais prendre comme exemple la création d&#8217;un blog. Il ne s&#8217;agit pas de concurrencer WordPress ou dotclear, ce blog aura des fonctionnalités simples, comme l&#8217;affichage des articles, l&#8217;affichage par catégorie d&#8217;article et par auteur. Configuration Je pars du principe que votre Zend Server est correctement installé. Le répertoire d&#8217;installtion est /usr/local/zend. Création d&#8217;un lien symbolique sur le script zf.sh sudo ln -s /usr/local/zend/share/ZendFramework/bin/zf.sh /usr/bin/zf Création d&#8217;un projet Dans un premier temps, il faut se placer dans le répertoire destination. Dans mon cas, je me suis positionné dans [...]]]></description>
			<content:encoded><![CDATA[<p>Le Zend Framework, depuis sa version 1.8, a apporté une nouvelle fonctionnalité, le ZendTool. Cela permet de nous aider dans la mise en route d&#8217;un projet Zend Framework.</p>
<p>Pour cette série d&#8217;article, je vais prendre comme exemple la création d&#8217;un blog. Il ne s&#8217;agit pas de concurrencer WordPress ou dotclear, ce blog aura des fonctionnalités simples, comme l&#8217;affichage des articles, l&#8217;affichage par catégorie d&#8217;article et par auteur.</p>
<h3>Configuration</h3>
<p>Je pars du principe que votre Zend Server est correctement installé. Le répertoire d&#8217;installtion est /usr/local/zend.</p>
<p>Création d&#8217;un lien symbolique sur le script zf.sh</p>
<pre>sudo ln -s /usr/local/zend/share/ZendFramework/bin/zf.sh /usr/bin/zf</pre>
<h3>Création d&#8217;un projet</h3>
<p>Dans un premier temps, il faut se placer dans le répertoire destination. Dans mon cas, je me suis positionné dans mon répertoire Sites, à savoir /Users/jean/Sites</p>
<pre>zf create project blog</pre>
<p><img style="float: left; margin: 0 1em 1em 0;" title="Structure Zend FrameWork, mai 2009" src="/public/jean/tuto_zf/structure_zf.png" alt="Structure Zend FrameWork" /> Nous retrouvons l&#8217;architecture sandard du Zend Framework, avec 3 répertoires principaux : application, library et public.</p>
<h4>public</h4>
<p>Ce répertoire est le répertoire de départ de notre site. Il contient uniquement le fichier index.php et .htaccess. C&#8217;est ici que nous ajouterons nos fichiers css, javascript et images.</p>
<h4>library</h4>
<p>Ce répertoire contiendra vos classes et éventuellement le répertoire du Zend Framework s&#8217;il n&#8217;est pas configuré dans votre include_path.</p>
<h4>application</h4>
<p>C&#8217;est le coeur de notre application. Il est composé d&#8217;un fichier Bootstrap.php et de 4 répertoires : vos controlleurs (controllers), vos modèles (models), vos vues (views) et le répertoire de configuration (configs).</p>
<h3>Configuration du serveur Apache</h3>
<p>Pour faire fonctionner le site, il faut créer un virtual host dans notre serveur Apache, pour pointer sur notre répertoire public ajouter cela dans le fichier : /usr/local/zend/apache2/conf/extra/httpd-vhosts.conf</p>
<pre>&lt;virtualhost *:80&gt; DocumentRoot /Users/jean/Sites/blog/public ServerName blog &lt;/virtualhost&gt;</pre>
<p>ainsi que cette ligne dans votre fichier /etc/hosts</p>
<pre>127.0.0.1 blog</pre>
<p>redémarrage du serveur apache :</p>
<pre>sudo /usr/local/zend/bin/apachectl restart</pre>
<p>ouvrir la page http://blog/ dans votre navigateur, et vous devez voir cette page : <img style="display: block; margin: 0 auto;" title="ecran OK, mai 2009" src="/public/jean/tuto_zf/.ecran_ok_s.jpg" alt="ecran OK" /> Félicitation, votre projet est correctement configuré.</p>
<h3>Création de nos contrôleurs</h3>
<p>Pour cette exemple, je vais mette en place 2 contrôleurs : <strong>articles</strong>, pour l&#8217;affichage des articles, avec un affichage par auteur et catégorie, ainsi que <strong>auteurs</strong>, pour afficher la liste des auteurs et la page détail de l&#8217;auteur.</p>
<h4>Contrôleur articles</h4>
<p>Nous allons créer les actions suivantes, sauf l&#8217;action index, qui est créée directement avec le contrôleur :</p>
<ul>
<li>index : affichage des derniers articles, juste le teaser</li>
<li>categorie: pour l&#8217;affichage des articles pour une catégorie</li>
<li>auteur: affichage des articles pour un auteur</li>
<li>detail: affichage de l&#8217;article complet</li>
</ul>
<p>Voici les commandes  pour créér ce contrôleur, ainsi que les actions correspondantes :</p>
<pre>zf create controller articles zf create action categorie articles zf create action auteur articles zf create action detail articles</pre>
<h4>Contrôleur auteurs</h4>
<p>Il ne contient que les actions index et detail.</p>
<pre>zf create controller auteurs zf create action detail auteurs</pre>
<p>Comme on peut le voir dans l&#8217;image ci dessous, les controlleurs et vues sont automatiquement générés. <img style="display: block; margin: 0 auto;" title="structure-after.png, mai 2009" src="/public/jean/tuto_zf/structure-after.png" alt="structure-after.png" /></p>
<h3>Test</h3>
<p>Nous allons maintenant vérifier que tout cela fonctionne, en testant les urls suivantes :</p>
<ul>
<li>http://blog/articles</li>
<li>http://blog/articles/detail</li>
<li>http://blog/articles/categorie</li>
<li>http://blog/articles/auteur</li>
<li>http://blog/auteurs</li>
<li>http://blog/auteurs/detail</li>
</ul>
<h3>La suite</h3>
<p>Pour l&#8217;instant, ces pages ne contiennent pas grand chose, mais nous allons rapidement y remédier.</p>
<p>Dans le prochain billet, nous allons mettre en place la base de données, l&#8217;utilisation de DbTable et mettre en place l&#8217;affichage de ces données.</p>
<h3>A voir ou revoir :</h3>
<ul>
<li>Article 2 : <a href="/post/2009/08/25/Blog-en-ZF-etape-2-La-base-de-donnees-et-le-premier-affichage">La base de données</a></li>
<li>Article 3 : <a href="/post/2009/09/11/Blog-en-ZF-etape-3-Utilisation-du-Zend_Layout-pour-le-template">Zend_Layout et template</a></li>
</ul>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.netinfluence.com/2009/05/24/un-blog-en-zend-framework-etape-1-zend-tool/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Zend Server, l’environnement de développement parfait pour Mac.</title>
		<link>http://blog.netinfluence.com/2009/05/23/zend-server-l-environnement-de-developpement-parfait-pour-mac/</link>
		<comments>http://blog.netinfluence.com/2009/05/23/zend-server-l-environnement-de-developpement-parfait-pour-mac/#comments</comments>
		<pubDate>Sat, 23 May 2009 14:25:00 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[create]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend Server]]></category>

		<guid isPermaLink="false">http://blog.netinfluence.ch/?p=42</guid>
		<description><![CDATA[Bien que le Mac soit pour moi une des meilleures machines pour le développement, la configuration de PHP relevait plus du parcours du combattant que de la promenade de santé. Je ne parle pas de la configuration par défaut, mais d&#8217;une installation spécifique. Php5 est inclus dans Leopard, mais ses fonctionnalités ne sont pas complètes. Par exemple, si vous avez besoin de certaines librairies, comme la librairie graphique GD2 ou encore les connexions PDO, il faut en passer par une recompilation, ce qui n&#8217;est pas le plus simple. Zend nous propose maintenant un serveur d&#8217;applications Web, le Zend Server. Il existe en 2 versions, une version gratuite, le Zend Server Community Edition et une version payante, le Zend Server. 1. [...]]]></description>
			<content:encoded><![CDATA[<p>Bien que le Mac soit pour moi une des meilleures machines pour le développement, la configuration de PHP relevait plus du parcours du combattant que de la promenade de santé. Je ne parle pas de la configuration par défaut, mais d&#8217;une installation spécifique.</p>
<p>Php5 est inclus dans Leopard, mais ses fonctionnalités ne sont pas complètes. Par exemple,  si vous avez besoin de certaines librairies, comme la librairie graphique GD2 ou encore les connexions PDO, il faut en passer par une recompilation, ce qui n&#8217;est pas le plus simple.</p>
<p>Zend nous propose maintenant un serveur d&#8217;applications Web, le <strong>Zend Server</strong>. Il existe en 2 versions, une version gratuite, le Zend Server Community Edition et une version payante, le Zend Server.</p>
<h3>1. Installation</h3>
<p>Pour mettre en place cet environnement de développement, il faut commencer par downloader la version 4.0.2 du Zend Server. Pour cela, rendez vous sur le site de Zend : <a hreflang="fr" href="http://www.zend.com/fr/products/server/downloads">http://www.zend.com/fr/products/server/downloads</a></p>
<p>Ensuite, il suffit de suivre la procédure d&#8217;installation. Par défaut, l&#8217;installation sera faite dans : /usr/local/zend/.</p>
<p>Par rapport aux anciennes versions, le Zend Server est maintenant installé avec un serveur MySql et phpMyAdmin. On se retrouve avec un environnement  prêt à l&#8217;usage.</p>
<h3>2. Administration du Zend Server</h3>
<p>Lors du premier accès à l&#8217;interface d&#8217;administration, qui se trouve à l&#8217;url http://localhost:10081/, un mot de passe  devra être défini. C&#8217;est via cette interface, que vous allez contrôler votre installation Php. Cette interface est composé de plusieurs onglets, dont 2 principaux : <img style="display: block; margin: 0 auto;" title="menu.png, mai 2009" src="/public/jean/zend_server/.menu_m.jpg" alt="menu.png" /></p>
<h4>L&#8217;onglet Monitor</h4>
<p>Cet onglet vous donne accès au Dashboard, dans lequel vous pourrez retrouver les liens sur PhpMyAdmin par exemple. On a aussi un accès au phpinfo et aux différents logs.</p>
<h4>L&#8217;Onglet Server Setup.</h4>
<h5>a. Extension</h5>
<p>Le sous menu Extensions va nous permettre de configurer les extensions Php, simplement en indiquant que l&#8217;on désire activer ou non une extension. <img style="display: block; margin: 0 auto;" title="extensions.png, mai 2009" src="/public/jean/zend_server/.extensions_m.jpg" alt="extensions.png" /></p>
<h5>b. Directives</h5>
<p>Le sous menu Directives permet l&#8217;édition des directives. Oublier les modifications en ligne de commande de votre fichier php.ini, l&#8217;édition de ces valeurs se fait simplement via l&#8217;interface. <img style="display: block; margin: 0 auto;" title="directives.png, mai 2009" src="/public/jean/zend_server/.directives_m.jpg" alt="directives.png" /></p>
<h5>c. Debugger</h5>
<p>Le sous menu Debugger permet de configurer le debugger pour les clients Zend Studio.</p>
<p>Un bouton en bas de la page va permettre le redémarrage de Php directement depuis cette interface.</p>
<h3>3. Partie FrontEnd</h3>
<p>On accède via http://localhost:10088/ au site par défaut. On se retrouve alors avec un PHP configuré avec Pdo et GD2 parfaitement opérationnel. De plus, le Zend Framework se trouve lui aussi installé, dans sa version 1.8.0.</p>
<p>Pour garder la même configuration que mon environnement actuel, j&#8217;ai créé des Vhosts pointant sur mon répertoire Sites. Il est aussi possible d&#8217;utiliser le port 80, en désactivant le partage web de Mac. il suffit de changer les numéros de port dans les fichiers de configuration d&#8217;Apache.</p>
<h3>Conclusion</h3>
<p>Après les galères de la recompilation de Php, j&#8217;avoue ne plus pouvoir me passer de ce Zend server. Il m&#8217;apporte un confort d&#8217;installation remarquable.</p>
<p>Mon mac se retrouve maintenant avec un environnement de développement parfaitement opérationnel, pour mes développement Zend Framework.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.netinfluence.com/2009/05/23/zend-server-l-environnement-de-developpement-parfait-pour-mac/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Passage au Zend Framework 1.8 et l’autoloader</title>
		<link>http://blog.netinfluence.com/2009/05/04/passage-au-zend-framework-1-8-et-l-autoloader/</link>
		<comments>http://blog.netinfluence.com/2009/05/04/passage-au-zend-framework-1-8-et-l-autoloader/#comments</comments>
		<pubDate>Mon, 04 May 2009 11:33:00 +0000</pubDate>
		<dc:creator>julien</dc:creator>
				<category><![CDATA[create]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.netinfluence.ch/?p=40</guid>
		<description><![CDATA[Si vous avez une application qui tourne parfaitement bien sur la version 1.7.8 du zend framework (ou une version plus ancienne d&#8217;ailleurs) et que vous voulez passer à la version 1.8, ceci pourra vous aider. En effet, vous aller vite remarquer que plus rien ne fonctionne et vous aurez une erreur du genre : Notice: Zend_Loader::Zend_Loader::registerAutoload is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in /path/Zend/Loader.php on line 207 Pas de panique, c&#8217;est simplement la nouvelle gestion des espaces de noms (namespaces) du Zend Framework qui n&#8217;est plus compatible. La solution présentée ici et que vous trouverez également dans cet article permet de contourner le problème. Si vous deviez refaire une application en 1.8, [...]]]></description>
			<content:encoded><![CDATA[<p>Si vous avez une application qui tourne parfaitement bien sur la version 1.7.8 du zend framework (ou une version plus ancienne d&#8217;ailleurs) et que vous voulez passer à la version 1.8, ceci pourra vous aider. En effet, vous aller vite remarquer que plus rien ne fonctionne et vous aurez une erreur du genre :</p>
<p><strong>Notice</strong>: Zend_Loader::Zend_Loader::registerAutoload is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in <strong>/path/Zend/Loader.php</strong> on line <strong>207</strong></p>
<p>Pas de panique, c&#8217;est simplement la nouvelle gestion des espaces de noms (namespaces) du Zend Framework qui n&#8217;est plus compatible. La solution présentée ici et que vous trouverez également dans <a href="http://devzone.zend.com/article/4525-Developing-a-Comprehensive-Autoloader">cet article</a> permet de contourner le problème. Si vous deviez refaire une application en 1.8, il serait probablement préférable de passer par <a href="http://framework.zend.com/manual/en/zend.application.html">Zend_Application</a>, <a href="http://framework.zend.com/manual/en/zend.tool.framework.html">Zend_Tool_Framework</a> et <a href="http://framework.zend.com/manual/en/zend.tool.project.html">Zend_Tool_Project</a>.</p>
<p>Pour en revenir à notre cas, vous devez avoir un endroit dans votre code, probablement dans le bootstrap, où vous &#8220;lancer&#8221; l&#8217;autoload :</p>
<pre class="brush: php">require_once "../library/Zend/Loader.php";
Zend_Loader::registerAutoload();</pre>
<p>Il suffit de remplacer ces lignes par les suivantes, et le tour est joué :</p>
<pre class="brush: php">require_once "../library/Zend/Loader/Autoloader.php";
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader-&gt;setFallbackAutoloader(true);</pre>
<p>Amusez-vous bien avec le Zend Framework.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.netinfluence.com/2009/05/04/passage-au-zend-framework-1-8-et-l-autoloader/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installez votre propre PHP sur MAC OSX (Leopard)</title>
		<link>http://blog.netinfluence.com/2009/03/19/installez-votre-propre-php-sur-mac-osx-leopard/</link>
		<comments>http://blog.netinfluence.com/2009/03/19/installez-votre-propre-php-sur-mac-osx-leopard/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 08:32:00 +0000</pubDate>
		<dc:creator>julien</dc:creator>
				<category><![CDATA[create]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.netinfluence.ch/?p=39</guid>
		<description><![CDATA[MAC LEOPARD propose une version intégrée de php. Le problème de cette version est qu&#8217;elle ne peut pas être manipulée selon les besoins spécifiques du projet. Il est donc très intéressant de pouvoir utiliser une version personnelle de php et ainsi de pouvoir en faire ce que l&#8217;on veut. Voici les étapes que j&#8217;ai suivi pour avoir ma propre version. SYSTEME : PHP 5.2.9 Mac OSX 10.5.6 LEOPARD 2.4 GHz Intel Core 2 Duo Darwin 9.6.0 TELECHARGEMENT : Téléchargez PHP depuis http://www.php.net/downloads.php Choisir une des deux archives suivantes : Déposez et ouvrez l&#8217;archive où vous voulez. Personnellement, je la conserve dans le répertoire &#8220;Téléchargements&#8221;, mais c&#8217;est un choix comme un autre. CONFIGURE : Si vous avez déjà la version php &#8220;par défaut&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>MAC LEOPARD propose une version intégrée de php. Le problème de cette version est qu&#8217;elle ne peut pas être manipulée selon les besoins spécifiques du projet. Il est donc très intéressant de pouvoir utiliser une version personnelle de php et ainsi de pouvoir en faire ce que l&#8217;on veut. Voici les étapes que j&#8217;ai suivi pour avoir ma propre version.</p>
<h2>SYSTEME :</h2>
<p>PHP 5.2.9<br />
Mac OSX 10.5.6 LEOPARD<br />
2.4 GHz Intel Core 2 Duo<br />
Darwin 9.6.0</p>
<h2>TELECHARGEMENT :</h2>
<ul>
<li>Téléchargez PHP depuis <a href="http://www.php.net/downloads.php">http://www.php.net/downloads.php</a></li>
<li>Choisir une des deux archives suivantes :<br />
<img title="Téléchargement de php5.2.9, mar. 2009" src="/public/julien/download_php.png" alt="" /></li>
<li>Déposez et ouvrez l&#8217;archive où vous voulez.<br />
Personnellement, je la conserve dans le répertoire &#8220;Téléchargements&#8221;, mais c&#8217;est un choix comme un autre.</li>
</ul>
<h2>CONFIGURE :</h2>
<p>Si vous avez déjà la version php &#8220;par défaut&#8221; qui fonctionne, vous pouvez récupérer votre chaîne &#8220;configure&#8221; avec un phpinfo().</p>
<p><img title="Configure d'un php info, mar. 2009" src="/public/julien/php_info_configure.png" alt="" /></p>
<p>La chaîne ci-dessous n&#8217;est qu&#8217;un exemple, il se peut qu&#8217;elle demande quelques modifications pour être cohérente avec votre système. Vous remarquerez le début de la chaîne qui indique que l&#8217;architecture qui sera utilisée est sur 64bits.</p>
<pre class="brush: plain;light: true;">CFLAGS="-arch x86_64" ./configure '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--with-apxs2=/usr/sbin/apxs' '--with-ldap=/usr' '--with-kerberos=/usr' '--enable-cli' '--with-zlib-dir=/usr' '--enable-trans-sid' '--with-xml' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-dbx' '--enable-sockets' '--with-iodbc=/usr' '--with-curl=/usr' '--with-config-file-path=/etc' '--sysconfdir=/private/etc' '--with-mysql-sock=/var/mysql' '--with-mysqli=/usr/bin/mysql_config' '--with-mysql=/usr/local/mysql' '--with-openssl' '--with-xmlrpc' '--with-xsl=/usr' '--without-pear'</pre>
<p>Dans le répertoire que vous venez de télécharger, vous trouverez le script configure.<br />
Vous pouvez donc lancez la commande ci-dessus (en ayant fait vos modifications si nécessaires).</p>
<h2>MAKE :</h2>
<p>Tapez ensuite la commande suivante :</p>
<p><span style="font-style: italic; font-weight: bold;">make test </span></p>
<p>Allez boire un café (ou autre chose, ça fonctionne aussi), parce que cette étape est assez longue (5/10 minutes). A la fin de cette étape, vous allez avoir un résumé des tests effectués et un certains nombre d&#8217;entre eux auront échoués (~20). Pas d&#8217;inquiétude, c&#8217;est normal.</p>
<h2>INSTALL :</h2>
<p>Il ne reste plus qu&#8217;à lancer la commande ci-dessous :</p>
<p><span style="font-style: italic; font-weight: bold;">sudo make install </span></p>
<p>et à redémarrer apache et Voilà !</p>
<h2>REMARQUES :</h2>
<ul>
<li>La string configure proposée est minimale, il vous faudra la compléter si vous voulez ajouter certaines options comme gd2 par exemple. Mais vous pouvez maintenant compilez votre php librement comme le demande bon nombre de tutoriaux.</li>
<li>FreeType pose quelques problèmes</li>
<li>Voici un lien intéressant pour ceux qui voudrait ajouter des modules sans les compilés. En effet, ce site propose une liste de modules déjà compilés en 64 bits : <a href="http://www.viames.it/mac-os-x.html">http://www.viames.it/mac-os-x.html</a></li>
<li>Tout ceci est-il bien nécessaire puisque ZendServer simplifie considérablement toutes ces procédures.</li>
</ul>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.netinfluence.com/2009/03/19/installez-votre-propre-php-sur-mac-osx-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

