<?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"
	>

<channel>
	<title>Zend Framework: Estado del Arte</title>
	<atom:link href="http://bolsadeideas.cl/zsamer/feed/" rel="self" type="application/rss+xml" />
	<link>http://bolsadeideas.cl/zsamer</link>
	<description></description>
	<pubDate>Thu, 18 Feb 2010 15:31:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>¡Iniciamos curso Zend Framework Febrero 2010!</title>
		<link>http://bolsadeideas.cl/zsamer/2010/01/%c2%a1iniciamos-curso-zend-framework-febrero-2010/</link>
		<comments>http://bolsadeideas.cl/zsamer/2010/01/%c2%a1iniciamos-curso-zend-framework-febrero-2010/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 19:28:16 +0000</pubDate>
		<dc:creator>zsamer</dc:creator>
		
		<category><![CDATA[Cursos]]></category>

		<category><![CDATA[MVC]]></category>

		<category><![CDATA[Model]]></category>

		<category><![CDATA[PHP5]]></category>

		<category><![CDATA[Patron de Diseño]]></category>

		<category><![CDATA[Zend Framwork]]></category>

		<guid isPermaLink="false">http://bolsadeideas.cl/zsamer/?p=76</guid>
		<description><![CDATA[Damos oficialmente el anuncio de apertura de inscripciones del curso Introducción a Zend Framework (5ta edición) que iniciará el 1ro de Febrero de 2010! 
 &#8216;Cursos Abiertos&#8217; &#60;&#62; &#8216;Cursos Intensivos&#8217;
 Les comento que los &#8216;cursos abiertos&#8217; se van armando de forma libre a medida que los alumnos se van registrando. Si sobre la fecha de [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align: justify;"><span style="color: #000000;">Damos oficialmente el anuncio de apertura de inscripciones del curso <a target="_blank" href="http://surforce.com/curso_zend.php">Introducción a Zend Framework (5ta edición)</a></span><span style="color: #000000;"> que iniciará el <span style="font-weight: bold;">1ro de Febrero de 2010</span>! </span></p>
<p><span style="color: #000000;"> <strong>&#8216;Cursos Abiertos&#8217; &lt;&gt; &#8216;Cursos Intensivos&#8217;</strong></span></p>
<p><span style="color: #000000;"> Les comento que los &#8216;cursos abiertos&#8217; se van armando de forma libre a medida que los alumnos se van registrando. Si sobre la fecha de inicio del curso no se llegó al cupo mínimo de 10 alumnos, se postergará una semana el inicio del curso. En caso de superar el máximo de 20 alumnos, se abrirá un único segundo grupo a la semana siguiente. El próximo período de cursos se abrirán recién a partir de Marzo 2010 (fecha a confirmar). </span></p>
<p><span style="color: #000000;">Todos los cursos tienen una duración promedio de 2 meses, pero <span style="font-weight: bold;">existe la posibilidad de armar grupos INTENSIVOS y REDUCIDOS de 1 mes de duración</span> (a un costo mayor). </span></p>
<p><span style="color: #000000;"> <strong>¡Promoción!</strong> </span></p>
<p><span style="color: #000000;">Es de público conocimiento que hace 3 años que los precios de los cursos se han mantenido invariables, por lo que este año aumentarán los &#8216;cursos abiertos&#8217; de <span style="font-weight: bold;">USD 50 </span>a<span style="font-weight: bold;"> USD 60</span>. Pero, a modo de promoción, <strong>quienes se inscriban durante esta semana</strong> (plazo hasta el domingo 24/1), lo podrán hacer a <strong>precio congelado</strong>! (luego no se aceptarán reclamos ;-)). </span></p>
<p><span style="color: #000000;"> ¡No pierdas tú lugar! Accede a <a href="http://usuarios.surforce.com/" target="_blank">usuarios.surforce.com</a> e ingresa a la sección COMPRAR. </span></p>
<p><span style="color: #000000;"> Toda la información sobre los cursos en <a href="http://surforce.com/" target="_blank">surforce.com</a> </span></p>
</div>
<p><span style="color: #000000;"><br />
Saludos! <img src='http://bolsadeideas.cl/zsamer/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://bolsadeideas.cl/zsamer/2010/01/%c2%a1iniciamos-curso-zend-framework-febrero-2010/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Doctrine 2: Enterprise Persistence Layer for PHP 5.3</title>
		<link>http://bolsadeideas.cl/zsamer/2009/11/doctrine-2-enterprise-persistence-layer-for-php-53/</link>
		<comments>http://bolsadeideas.cl/zsamer/2009/11/doctrine-2-enterprise-persistence-layer-for-php-53/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 15:02:43 +0000</pubDate>
		<dc:creator>zsamer</dc:creator>
		
		<category><![CDATA[Doctrine 2]]></category>

		<category><![CDATA[Model]]></category>

		<category><![CDATA[ORM]]></category>

		<category><![CDATA[PHP5]]></category>

		<category><![CDATA[Patron de Diseño]]></category>

		<category><![CDATA[Zend Framwork]]></category>

		<guid isPermaLink="false">http://bolsadeideas.cl/zsamer/?p=75</guid>
		<description><![CDATA[Quería compartir con ustedes una presentación muy buena sobre Doctrine 2 y las grandes ventajas que tiene respecto a sus otras versiones como la 1.2, resumiendo:

Es mucho más rápido, 30% menos en uso de memoria
100% desacoplado
Las clases de entidades no necesitan heredan de ninguna otra clase como en la 1.2 que obliga la herencia de [...]]]></description>
			<content:encoded><![CDATA[<p>Quería compartir con ustedes una presentación muy buena sobre Doctrine 2 y las grandes ventajas que tiene respecto a sus otras versiones como la 1.2, resumiendo:</p>
<ul>
<li>Es mucho más rápido, 30% menos en uso de memoria</li>
<li>100% desacoplado</li>
<li>Las clases de entidades no necesitan heredan de ninguna otra clase como en la 1.2 que obliga la herencia de Doctrine_Record, entidades mucho más desacopladas y reutilizables.</li>
<li>NO nos impone otros métodos, propiedades, y otras basura en nuestro modelo de objetos de dominio o clases de entidades (En java se les conocen como <a href="http://es.wikipedia.org/wiki/Plain_Old_Java_Object">POJO</a>, <a href="http://en.wikipedia.org/wiki/Data_transfer_object">DTO</a> o Entity), ídem lo anterior, mucho más limpias y reutilizables</li>
<li>Desarrollado completamente en PHP5.3, el futuro de PHP y desarrollo de aplicaciones empresariales</li>
<li>Uso de namespace</li>
<li>Toma lo mejor de los ORM de Java, está basado en Hibernate y <a href="http://java.sun.com/javaee/5/docs/tutorial/doc/bnbqw.html">EntityManager</a> y <a href="http://java.sun.com/developer/technicalArticles/J2EE/jpa/">JPA (Java Persistence API )</a></li>
<li>Mucho más elegante, con estándares y buenas prácticas OOP e implementación de patrones de diseños</li>
<li>y muchas otras</li>
</ul>
<p>Les dejo la presentación de Jonathan Wage (miembro del equipo de desarrollo de Doctrine 2), muy recomendado, lo que si está en ingles <img src='http://bolsadeideas.cl/zsamer/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<div style="width:425px;text-align:left" id="__ss_2447048"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/jwage/doctrine-2-enterprise-persistence-layer-for-php" title="Doctrine 2: Enterprise Persistence Layer for PHP">Doctrine 2: Enterprise Persistence Layer for PHP</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=biglampcamp2009-091107173520-phpapp02&#038;stripped_title=doctrine-2-enterprise-persistence-layer-for-php" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=biglampcamp2009-091107173520-phpapp02&#038;stripped_title=doctrine-2-enterprise-persistence-layer-for-php" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/jwage">Jonathan Wage</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://bolsadeideas.cl/zsamer/2009/11/doctrine-2-enterprise-persistence-layer-for-php-53/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Doctrine 2 ORM en Zend Framewok: parte II</title>
		<link>http://bolsadeideas.cl/zsamer/2009/11/doctrine-2-orm-en-zend-framewok-parte-ii/</link>
		<comments>http://bolsadeideas.cl/zsamer/2009/11/doctrine-2-orm-en-zend-framewok-parte-ii/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 20:12:54 +0000</pubDate>
		<dc:creator>zsamer</dc:creator>
		
		<category><![CDATA[Doctrine 2]]></category>

		<category><![CDATA[MVC]]></category>

		<category><![CDATA[Model]]></category>

		<category><![CDATA[ORM]]></category>

		<category><![CDATA[PHP5]]></category>

		<category><![CDATA[Patron de Diseño]]></category>

		<category><![CDATA[Zend Framwork]]></category>

		<guid isPermaLink="false">http://bolsadeideas.cl/zsamer/?p=74</guid>
		<description><![CDATA[Continuando con nuestro articulo anterior Doctrine 2 ORM en Zend Framewok: parte I, en esta oportunidad quiero compartir unos tips de como integrar ORM Doctrine 2 con Zend Framework, para ello va ser necesario haber leido también el articulo sobre Bootstrapping con Zend Application, que será nuestra base para la integración.
Lo primero que tenemos que [...]]]></description>
			<content:encoded><![CDATA[<p>Continuando con nuestro articulo anterior <a href="http://bolsadeideas.cl/zsamer/2009/11/doctrine-2-orm-en-zend-framewok-parte-i/">Doctrine 2 ORM en Zend Framewok: parte I</a>, en esta oportunidad quiero compartir unos tips de como integrar ORM <a href="http://www.doctrine-project.org/documentation/2_0/en">Doctrine </a>2 con Zend Framework, para ello va ser necesario haber leido también el articulo sobre <a href="http://bolsadeideas.cl/zsamer/2009/08/bootstrapping-con-zend-application/">Bootstrapping con Zend Application</a>, que será nuestra base para la integración.</p>
<p>Lo primero que tenemos que hacer es descargar <a href="http://www.doctrine-project.org/download">Doctrine 2 (actualmente 2.0.0-ALPHA3)</a>, descomprimir en la carpeta <strong>"library" </strong> del proyecto Zend y luego agregar en application.ini las siguientes lineas:</p>
<div class="igBar"><span id="lcode-8"><a href="#" onclick="javascript:showPlainTxt('code-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-8">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">autoloaderNamespaces.<span style="">doctrine</span> = <span style="color:#CC0000;">"Doctrine"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">autoloaderNamespaces.<span style="">proxies</span> = <span style="color:#CC0000;">"Proxies"</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Con esto agregamos las librerías de Doctrine 2 en el Include Path de PHP.</p>
<p>Lo segundo que tenemos que hacer es crear un método _init en la clase Boostrap, a éste método le llamaremos _initDoctrine, obviamente <img src='http://bolsadeideas.cl/zsamer/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<div class="igBar"><span id="lphp-9"><a href="#" onclick="javascript:showPlainTxt('php-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-9">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> Bootstrap extends Zend_Application_Bootstrap_Bootstrap</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; protected <span style="color:#000000; font-weight:bold;">function</span> _initDoctrine<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$config</span> = <span style="color:#000000; font-weight:bold;">new</span> Configuration<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$cache</span> = <span style="color:#000000; font-weight:bold;">new</span> ApcCache<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$config</span>-&gt;<span style="color:#006600;">setMetadataCacheImpl</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$cache</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$config</span>-&gt;<span style="color:#006600;">setQueryCacheImpl</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$cache</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$config</span>-&gt;<span style="color:#006600;">setProxyDir</span><span style="color:#006600; font-weight:bold;">&#40;</span>APPLICATION_PATH . <span style="color:#FF0000;">"/../library"</span> . DIRECTORY_SEPARATOR.<span style="color:#FF0000;">'Proxies'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$config</span>-&gt;<span style="color:#006600;">setProxyNamespace</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Proxies'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$connPDO</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">bootstrap</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'db'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$connPDO</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'pdo'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">getResource</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'db'</span><span style="color:#006600; font-weight:bold;">&#41;</span>-&gt;<span style="color:#006600;">getConnection</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$conn</span> = DriverManager::<span style="color:#006600;">getConnection</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$connPDO</span>, <span style="color:#0000FF;">$config</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$em</span> = EntityManager::<span style="color:#006600;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$conn</span>, <span style="color:#0000FF;">$config</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; Zend_Registry::<span style="color:#006600;">set</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'em'</span>, <span style="color:#0000FF;">$em</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$em</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Podemos observar que hace uso de <a href="http://php.net/manual/en/language.namespaces.php">namespace incluido en la versión 5.3 de PHP</a>, también observamos que se hace uso de la conexión a la base de datos de Zend Db ($this->bootstrap('db')), configurado en <strong>"application.ini"</strong>, obtenemos el objeto PDO de conexión y se lo entregamos al DriverManager de Doctrine 2 <img src='http://bolsadeideas.cl/zsamer/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> todo muy elegante ¿no?, finalmente lo guardamos en el Zend_Registry.<br />
<span id="more-74"></span><br />
Luego creamos las clase Entity, que representan un objeto de dominio del sistema:</p>
<p>Address:</p>
<div class="igBar"><span id="lphp-10"><a href="#" onclick="javascript:showPlainTxt('php-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-10">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">namespace doctrineorm\models\entity;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * @Entity</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * @Table(name=&quot;addresses&quot;) </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> Address <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;* @Id</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;* @Column(type=&quot;integer&quot;)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;* @GeneratedValue(strategy=&quot;AUTO&quot;)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private <span style="color:#0000FF;">$id</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/** @Column(type=&quot;string&quot;, length=255) */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private <span style="color:#0000FF;">$street</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/** @OneToOne(targetEntity=&quot;User&quot;, mappedBy=&quot;address&quot;) */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private <span style="color:#0000FF;">$user</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> getId<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">id</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> getStreet<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">street</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> setStreet<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$street</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">street</span> = <span style="color:#0000FF;">$street</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> getUser<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">user</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> setUser<span style="color:#006600; font-weight:bold;">&#40;</span>User <span style="color:#0000FF;">$user</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">user</span> !== <span style="color:#0000FF;">$user</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">user</span> = <span style="color:#0000FF;">$user</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$user</span>-&gt;<span style="color:#006600;">setAddress</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
y<br />
User:</p>
<div class="igBar"><span id="lphp-11"><a href="#" onclick="javascript:showPlainTxt('php-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-11">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">namespace doctrineorm\models\entity;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * @Entity</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * @Table(name=&quot;users&quot;)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> User <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;* @Id</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;* @Column(type=&quot;integer&quot;)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;* @GeneratedValue(strategy=&quot;AUTO&quot;)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private <span style="color:#0000FF;">$id</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/** @Column(type=&quot;string&quot;, length=50) */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private <span style="color:#0000FF;">$name</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/**</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;* @OneToOne(targetEntity=&quot;Address&quot;)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;* @JoinColumn(name=&quot;address_id&quot;, referencedColumnName=&quot;id&quot;)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private <span style="color:#0000FF;">$address</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> getId<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">id</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> getName<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">name</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> setName<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$name</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">name</span> = <span style="color:#0000FF;">$name</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> getAddress<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">address</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> setAddress<span style="color:#006600; font-weight:bold;">&#40;</span>Address <span style="color:#0000FF;">$address</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">address</span> !== <span style="color:#0000FF;">$address</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">address</span> = <span style="color:#0000FF;">$address</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$address</span>-&gt;<span style="color:#006600;">setUser</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Sin entrar en mucho detalle, ya que no es objetivo del post abundar, vemos que las relaciones entre clases se configuran mediante anotaciones (docblock annotations), <a href="http://www.doctrine-project.org/documentation/manual/2_0/en/association-mapping">más información aquí...</a>.</p>
<p>Nuestra clase de <a href="http://es.wikipedia.org/wiki/Data_Access_Object">Modelo DAO</a> UserDao:</p>
<div class="igBar"><span id="lphp-12"><a href="#" onclick="javascript:showPlainTxt('php-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-12">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/**</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * Description of UserDao</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> *</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> * @author Andrés Guzmán</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;"> */</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">"doctrineorm/models/entity/User.php"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">"doctrineorm/models/entity/Address.php"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">use doctrineorm\models\entity\User;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">use doctrineorm\models\entity\Address;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> Doctrineorm_Model_UserDao</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> getEntityManager<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span>Zend_Registry::<span style="color:#006600;">isRegistered</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'em'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> Zend_Registry::<span style="color:#006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'em'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#000000; font-weight:bold;">null</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> findAll<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">getEntityManager</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>-&gt;<span style="color:#006600;">createQuery</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'select u from doctrineorm<span style="color:#000099; font-weight:bold;">\m</span>odels<span style="color:#000099; font-weight:bold;">\e</span>ntity<span style="color:#000099; font-weight:bold;">\U</span>ser u'</span><span style="color:#006600; font-weight:bold;">&#41;</span>-&gt;<span style="color:#006600;">getResult</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> save<span style="color:#006600; font-weight:bold;">&#40;</span>User <span style="color:#0000FF;">$user</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">getEntityManager</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>-&gt;<span style="color:#006600;">persist</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$user</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">getEntityManager</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>-&gt;<span style="color:#006600;">flush</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#008000;">/* ... etc, otros métodos del DAO (Data Access Object) ...*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La clase controladora <strong>IndexController.ph</strong>p dentro del módulo <strong>doctrineorm</strong>:</p>
<div class="igBar"><span id="lphp-13"><a href="#" onclick="javascript:showPlainTxt('php-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-13">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> Doctrineorm_IndexController extends Zend_Controller_Action</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private <span style="color:#0000FF;">$_model</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> init<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; parent::<span style="color:#006600;">init</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;_model = <span style="color:#000000; font-weight:bold;">new</span> Doctrineorm_Model_UserDao<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public <span style="color:#000000; font-weight:bold;">function</span> indexAction<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">view</span>-&gt;<span style="color:#006600;">title</span> = <span style="color:#FF0000;">"Hello World! Doctrine 2 and Zend Framework!"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">view</span>-&gt;<span style="color:#006600;">users</span> = <span style="color:#0000FF;">$this</span>-&gt;_model-&gt;<span style="color:#006600;">findAll</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Finalmente la vista index.phtml:</p>
<div class="igBar"><span id="lphp-14"><a href="#" onclick="javascript:showPlainTxt('php-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-14">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;h3&gt;&lt;?php <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">title</span> ?&gt;&lt;/h3&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">users</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$user</span><span style="color:#006600; font-weight:bold;">&#41;</span>: <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;strong&gt;Name:&lt;/strong&gt; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$user</span>-&gt;<span style="color:#006600;">getName</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#000000; font-weight:bold;">?&gt;</span> &amp;nbsp;-&amp;nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;strong&gt;Address:&lt;/strong&gt; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$user</span>-&gt;<span style="color:#006600;">getAddress</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>-&gt;<span style="color:#006600;">getStreet</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;br /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> endforeach; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Como ven, es bastante simple de integrar con Doctrine 2, bienvenidos al mundo de ORM con Doctrine 2 y Zend Framework!</p>
<p>Hasta la próxima! <img src='http://bolsadeideas.cl/zsamer/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://bolsadeideas.cl/zsamer/2009/11/doctrine-2-orm-en-zend-framewok-parte-ii/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Doctrine 2 ORM en Zend Framewok: parte I</title>
		<link>http://bolsadeideas.cl/zsamer/2009/11/doctrine-2-orm-en-zend-framewok-parte-i/</link>
		<comments>http://bolsadeideas.cl/zsamer/2009/11/doctrine-2-orm-en-zend-framewok-parte-i/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 19:16:37 +0000</pubDate>
		<dc:creator>zsamer</dc:creator>
		
		<category><![CDATA[Doctrine 2]]></category>

		<category><![CDATA[Model]]></category>

		<category><![CDATA[ORM]]></category>

		<category><![CDATA[PHP5]]></category>

		<category><![CDATA[Patron de Diseño]]></category>

		<category><![CDATA[Zend Framwork]]></category>

		<guid isPermaLink="false">http://bolsadeideas.cl/zsamer/?p=73</guid>
		<description><![CDATA[Como muchos sabemos Zend Framework ha estado desarrollando su propio ORM Zend Entity (definición de ORM), sin embargo el proyecto de ORM nativo de Zend ha quedado parado y descontinuado, el propio autor, Benjamin Eberlei (@beberlei (Twitter)), comenta las causas en el siguiente post.
Lamentable noticia, sin embargo ésta viene acompañada de una excelente noticia: a [...]]]></description>
			<content:encoded><![CDATA[<p>Como muchos sabemos Zend Framework ha estado desarrollando su propio <a href="http://n4.nabble.com/Discontinuing-Zend-Entity-in-favour-of-Doctrine-integration-td648011.html#a648011">ORM Zend Entity</a> (<a href="http://es.wikipedia.org/wiki/Mapeo_objeto-relacional">definición de ORM</a>), sin embargo el proyecto de ORM nativo de Zend ha quedado parado y descontinuado, el propio autor, Benjamin Eberlei (<a href="http://twitter.com/beberlei">@beberlei (Twitter)</a>), comenta las causas en el <a href="http://n4.nabble.com/Discontinuing-Zend-Entity-in-favour-of-Doctrine-integration-td648011.html#a648011">siguiente post</a>.</p>
<p>Lamentable noticia, sin embargo ésta viene acompañada de una excelente noticia: a partir de ahora, <strong>Benjamin Eberlei</strong> dedicará todos sus esfuerzos a mejorar el <a href="http://www.doctrine-project.org/blog/doctrine2-preview-release">ORM Doctrine 2</a> y su <a href="http://framework.zend.com/wiki/display/ZFPROP/ZF+and+Doctrine2+Integration+-+Benjamin+Eberlei">integración con el Zend Framework</a>, sin duda alguna, <a href="http://www.doctrine-project.org/blog/doctrine2-preview-release">Doctrine 2</a> es y lo será por lejos el mejor ORM de PHP desde su versión 5.3 (Doctrine 2 requiere PHP 5.3 o superior).</p>
<h3>Las razones que dieron lugar a esta decisión son las siguientes:</h3>
<ol>
<li>Le consume demasiado tiempo y ha llegado a una situación de bloqueo</li>
<li>Zend_Entity sólo tiene un desarrollador y por eso no tiene ni la mitad de características de Doctrine 2</li>
<li>La fecha prevista de finalización de Zend_Entity era de hasta seis meses, algo que no encaja muy bien con la planificación de las nuevas versiones de Zend Framework</li>
</ol>
<p><strong>Matthew Weier O’Phinney</strong>, máximo responsable de Zend Framework, está de acuerdo con la decisión y comenta al respecto:</p>
<blockquote><p>"creemos que ayudar a mejorar un proyecto existente Doctrine y trabajar en su integración con Zend Framework será mejor para toda la comunidad de PHP".</p></blockquote>
<p><span id="more-73"></span><br />
Lo más destacable de Doctrine 2 es que se basa completamente en <a href="http://java.sun.com/javaee/5/docs/tutorial/doc/bnbqw.html">EntityManager (Java EE 5)</a> y <a href="http://es.wikipedia.org/wiki/Java_Persistence_API">JPA (Java Persistence API)</a> con <a href="https://www.hibernate.org/">Hibernate</a> (El mejor ORM de JAVA EE), muy parecido. Una maravilla. Además de implementar las clases Entity como corresponde, éstas aceptan anotaciones (docblock annotations) en los métodos para definir las relaciones de clases y mapeos hacia las tablas de las Bases de Datos.</p>
<p>No por nada el mismísimo <a href="http://www.doctrine-project.org/download">Fabien Potencier</a>, el boss de Simphony, dice que: "<em><strong>... Doctrine 2 es lo mejor que le ha pasado al PHP en mucho tiempo</strong></em>" pero de momento sólo está disponible una <a href="http://www.doctrine-project.org/download">versión alpha 3</a> y no recomiendan su uso en proyectos de producción. A pesar de ello, creo es hora de empezar a probarlo.</p>
<p>Pienso que es una ventaja para la comunidad de Zend Framework pues ahora ya tenemos clara la herramienta a utilizar: bienvenido Doctrine 2.0 !</p>
<p>Continuamos en: <a href="http://bolsadeideas.cl/zsamer/2009/11/doctrine-2-orm-en-zend-framewok-parte-ii/">Doctrine 2 ORM en Zend Framewok: parte II</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bolsadeideas.cl/zsamer/2009/11/doctrine-2-orm-en-zend-framewok-parte-i/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cambio de fecha de inicio de cursos: lunes 12 de Octubre</title>
		<link>http://bolsadeideas.cl/zsamer/2009/10/cambio-de-fecha-de-inicio-de-cursos-lunes-12-de-octubre/</link>
		<comments>http://bolsadeideas.cl/zsamer/2009/10/cambio-de-fecha-de-inicio-de-cursos-lunes-12-de-octubre/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 13:46:29 +0000</pubDate>
		<dc:creator>zsamer</dc:creator>
		
		<category><![CDATA[Cursos]]></category>

		<guid isPermaLink="false">http://bolsadeideas.cl/zsamer/?p=72</guid>
		<description><![CDATA[Fecha de comienzo de curso a distancia Lunes 12 de Octubre, Introducción a Zend Framework.
Si aún no estás registrado en SURFORCE, ingresa TUS DATOS REALES (incluyendo la foto) en http://registracion.surforce.com (los datos son privados y confidenciales, sin ellos, no voy a enviar datos de pago ni habilitar alumnos bajo seudónimos ni nombres fantasía).
Aún quedan pocos [...]]]></description>
			<content:encoded><![CDATA[<p>Fecha de comienzo de curso a distancia Lunes 12 de Octubre, Introducción a Zend Framework.</p>
<p><span style="font-weight: bold;">Si aún no estás registrado en <a href="http://www.surforce.com/">SURFORCE</a></span>, ingresa TUS DATOS REALES (incluyendo la foto) en <a href="http://registracion.surforce.com/">http://registracion.surforce.com</a> (los datos son privados y confidenciales, sin ellos, no voy a enviar datos de pago ni habilitar alumnos bajo seudónimos ni nombres fantasía).</p>
<p><strong>Aún quedan pocos lugares en el curso para llegar al tope máximo de 20 alumnos, NO pierdas tu lugar.<br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://bolsadeideas.cl/zsamer/2009/10/cambio-de-fecha-de-inicio-de-cursos-lunes-12-de-octubre/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Últimos cursos del año 2009</title>
		<link>http://bolsadeideas.cl/zsamer/2009/09/ultimos-cursos-del-ano-2009/</link>
		<comments>http://bolsadeideas.cl/zsamer/2009/09/ultimos-cursos-del-ano-2009/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 04:23:28 +0000</pubDate>
		<dc:creator>zsamer</dc:creator>
		
		<category><![CDATA[Cursos]]></category>

		<category><![CDATA[PHP5]]></category>

		<category><![CDATA[Patron de Diseño]]></category>

		<category><![CDATA[Zend Framwork]]></category>

		<guid isPermaLink="false">http://bolsadeideas.cl/zsamer/?p=71</guid>
		<description><![CDATA[Plazo para inscribirse hasta el Viernes 2 de Octubre.
Fecha de comienzo de cursos a distancia Lunes 5 de Octubre, Zend Framework y PHP5 OOP.
Si aún no estás registrado en SURFORCE, ingresa TUS DATOS REALES (incluyendo la foto) en http://registracion.surforce.com (los datos son privados y confidenciales, sin ellos, no voy a enviar datos de pago ni [...]]]></description>
			<content:encoded><![CDATA[<p>Plazo para <strong>inscribirse hasta el Viernes 2 de Octubre</strong>.</p>
<p>Fecha de comienzo de cursos a distancia <strong>Lunes 5 de Octubre</strong>, Zend Framework y PHP5 OOP.</p>
<p><span style="font-weight: bold;">Si aún no estás registrado en <a href="http://www.surforce.com/">SURFORCE</a></span>, ingresa TUS DATOS REALES (incluyendo la foto) en <a href="http://registracion.surforce.com/">http://registracion.surforce.com</a> (los datos son privados y confidenciales, sin ellos, no voy a enviar datos de pago ni habilitar alumnos bajo seudónimos ni nombres fantasía).</p>
<p>Los cursos se dictarán a través de <a href="http://es.wikipedia.org/wiki/Moodle">Moodle</a> (sistema de educación a distancia) en la dirección <a href="http://formacion.surforce.com/">http://formacion.surforce.com</a></p>
<p><strong>Aún quedan algunos lugares en los cursos para llegar al tope máximo de 20 alumnos</strong>, así que quién envíe el pago inmediatamente obtiene el lugar disponible que aún no se ha pago.</p>
<p><iframe src="http://docs.google.com/present/embed?id=ddqnpxpj_731gqhqc56r" frameborder="0" width="410" height="342"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://bolsadeideas.cl/zsamer/2009/09/ultimos-cursos-del-ano-2009/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Inicio de cursos Zend Framework 7/Septiembre</title>
		<link>http://bolsadeideas.cl/zsamer/2009/09/inicio-de-cursos-zend-framework-7septiembre/</link>
		<comments>http://bolsadeideas.cl/zsamer/2009/09/inicio-de-cursos-zend-framework-7septiembre/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 22:41:45 +0000</pubDate>
		<dc:creator>zsamer</dc:creator>
		
		<category><![CDATA[Cursos]]></category>

		<category><![CDATA[Zend Framwork]]></category>

		<guid isPermaLink="false">http://bolsadeideas.cl/zsamer/?p=70</guid>
		<description><![CDATA[Si aún no estás registrado en SURFORCE, ingresa TUS DATOS REALES (incluyendo la foto) en http://registracion.surforce.com (los datos son privados y confidenciales, sin ellos, no voy a enviar datos de pago ni habilitar alumnos bajo seudónimos ni nombres fantasía).
Los cursos se dictarán a través de Moodle (sistema de educación a distancia) en la dirección http://formacion.surforce.com
Aún [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: bold;">Si aún no estás registrado en <a href="http://www.surforce.com/">SURFORCE</a></span>, ingresa TUS DATOS REALES (incluyendo la foto) en <a href="http://registracion.surforce.com/">http://registracion.surforce.com</a> (los datos son privados y confidenciales, sin ellos, no voy a enviar datos de pago ni habilitar alumnos bajo seudónimos ni nombres fantasía).</p>
<p>Los cursos se dictarán a través de <a href="http://es.wikipedia.org/wiki/Moodle">Moodle</a> (sistema de educación a distancia) en la dirección <a href="http://formacion.surforce.com/">http://formacion.surforce.com</a></p>
<p><strong>Aún quedan algunos lugares en los cursos para llegar al tope máximo de 20 alumnos</strong>, así que quién envíe el pago inmediatamente obtiene el lugar disponible que aún no se ha pago.</p>
<p><span style="font-weight: bold;">¡Última semana, si no te inscribiste aún, luego no hay más excusas! <img src='http://bolsadeideas.cl/zsamer/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://bolsadeideas.cl/zsamer/2009/09/inicio-de-cursos-zend-framework-7septiembre/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bootstrapping con Zend Application</title>
		<link>http://bolsadeideas.cl/zsamer/2009/08/bootstrapping-con-zend-application/</link>
		<comments>http://bolsadeideas.cl/zsamer/2009/08/bootstrapping-con-zend-application/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 01:34:16 +0000</pubDate>
		<dc:creator>zsamer</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Agregar nueva etiqueta]]></category>

		<guid isPermaLink="false">http://bolsadeideas.cl/zsamer/?p=68</guid>
		<description><![CDATA[Zend_Tool es una poderosa herramienta de Zend Framework que nos permite crear la estructura base de un proyecto Zend con todos sus directorios y componentes,  como así también aprovechar un diseño estándar de proyecto y una primer clase de arranque (bootstrap) diseñada por los propios creadores del framework, ubicación para los archivos de configuración, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Zend_Tool</strong> es una poderosa herramienta de Zend Framework que <strong>nos permite crear la estructura base de un proyecto Zend con todos sus directorios y componentes</strong>,  como así también aprovechar un diseño estándar de proyecto y una primer clase de arranque (bootstrap) diseñada por los propios creadores del framework, ubicación para los archivos de configuración, diferenciación de entornos de ejecución (producción, desarrollo, etc), y muchos detalles más.</p>
<h3>Crear nuestro proyecto base</h3>
<p>Haremos un ejemplo basado en un sistema operativo como GNU/Linux, aunque esto bien se puede hacer también desde Windows a través de un .bat.</p>
<p>Dentro de nuestro web root, en Linux utilizando xampp: /opt/lampp/htdocs/</p>
<div class="igBar"><span id="lcode-37"><a href="#" onclick="javascript:showPlainTxt('code-37'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-37">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$ mkdir /opt/lampp/htdocs/proyecto-zf</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$ cd /opt/lampp/htdocs/proyecto-zf</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$ zf create project .</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">Creating</span> project at /opt/lampp/htdocs/proyecto-zf </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Luego nos creará una estructura inicial para nuestro proyecto<span id="more-68"></span>:</p>
<div class="igBar"><span id="lcode-38"><a href="#" onclick="javascript:showPlainTxt('code-38'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-38">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">nuevo-proyecto-zf</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|-- application</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp;|-- Bootstrap.<span style="">php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp;|-- configs</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp;|&nbsp; &nbsp;`-- application.<span style="">ini</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp;|-- controllers</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp;|&nbsp; &nbsp;|-- ErrorController.<span style="">php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp;|&nbsp; &nbsp;`-- IndexController.<span style="">php</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp;|-- models</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp;`-- views</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp; &nbsp; &nbsp;|-- helpers</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp; &nbsp; &nbsp;`-- scripts</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|-- error</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp;`-- error.<span style="">phtml</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;`-- index</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;`-- index.<span style="">phtml</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|-- library</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|-- public</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|&nbsp; &nbsp;`-- index.<span style="">php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">`-- tests</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; |-- application</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; |&nbsp; &nbsp;`-- bootstrap.<span style="">php</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; |-- library</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; |&nbsp; &nbsp;`-- bootstrap.<span style="">php</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; `-- phpunit.<span style="">xml</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>De la estructura generada podemos observar lo siguiente:<br />
Primero que todo, tenemos al directorio <strong>public</strong>. Este no solo guarda nuestro <strong>index.php</strong> quien se encarga de arrancar nuestra aplicación, sino que además <strong>contiene archivo de imágenes, hojas de estilos css, javascript etc.</strong></p>
<p>Luego tenemos el directorio <strong>library</strong>, lugar donde guardamos nuestros propios componentes o librerías y las de Zend.</p>
<p>Después vemos que tenemos la carpeta <strong>tests</strong>, lugar donde llevaremos a cabo nuestras “pruebas unitarias” (testing). Esto puede ser usado generalmente para probar los modelos que deben contener la lógica de negocio y nuestros controladores.</p>
<p>Por último pero no menos importante es el directorio de la aplicación “<strong>application</strong>”. Este es considerado como el más importante, ya que es donde creamos y guardamos nuestra aplicación MVC, los controladores, modelo, vistas (script o plantillas y view helper) y archivos de configuración.<br />
Se generó un directorio para nuestros archivos de configuración llamado <strong>configs</strong>, donde a su vez podemos ver un archivo <strong>application.ini</strong> que cuenta con los primeros parámetros que podemos definir en nuestra aplicación (entorno de producción, desarrollo, testing, si iniciar con el despliegue de mensajes de error, etc).</p>
<p>Nuestro archivo <strong>index.php</strong> ubicado dentro del directorio “<strong>public</strong>” quedaría más o menos con el siguiente contenido:</p>
<div class="igBar"><span id="lphp-39"><a href="#" onclick="javascript:showPlainTxt('php-39'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-39">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Define path to application directory</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/defined"><span style="color:#000066;">defined</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'APPLICATION_PATH'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; || <a href="http://www.php.net/define"><span style="color:#000066;">define</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'APPLICATION_PATH'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/realpath"><span style="color:#000066;">realpath</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/dirname"><span style="color:#000066;">dirname</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'/../application'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Define application environment</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/defined"><span style="color:#000066;">defined</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'APPLICATION_ENV'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; || <a href="http://www.php.net/define"><span style="color:#000066;">define</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'APPLICATION_ENV'</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/getenv"><span style="color:#000066;">getenv</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'APPLICATION_ENV'</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? <a href="http://www.php.net/getenv"><span style="color:#000066;">getenv</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'APPLICATION_ENV'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: <span style="color:#FF0000;">'production'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Typically, you will also want to add your library/ directory</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// to the include_path, particularly if it contains your ZF installed</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/set_include_path"><span style="color:#000066;">set_include_path</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/implode"><span style="color:#000066;">implode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span>PATH_SEPARATOR, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/dirname"><span style="color:#000066;">dirname</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/dirname"><span style="color:#000066;">dirname</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">'/library'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/get_include_path"><span style="color:#000066;">get_include_path</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/** Zend_Application */</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'Zend/Application.php'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Create application, bootstrap, and run</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$application</span> = <span style="color:#000000; font-weight:bold;">new</span> Zend_Application<span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; APPLICATION_ENV,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; APPLICATION_PATH . <span style="color:#FF0000;">'/configs/application.ini'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$application</span>-&gt;<span style="color:#006600;">bootstrap</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -&gt;<span style="color:#006600;">run</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Podemos notar que la constante de ambiente de la aplicación "<strong>APPLICATION_ENV</strong>" referida al entorno o ambiente en que estemos, tales como de <strong>desarrollo, producción o test</strong>, esta se puede obtener directamente de la configuración del servidor web Apache, una <strong>recomendación </strong>puede ser configurarla directamente en el archivo htaccess, dentro del directorio “<strong>public</strong>”:</p>
<div class="igBar"><span id="lcode-40"><a href="#" onclick="javascript:showPlainTxt('code-40'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-40">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SetEnv APPLICATION_ENV development</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RewriteEngine On</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RewriteCond %<span style="color:#006600; font-weight:bold;">&#123;</span>REQUEST_FILENAME<span style="color:#006600; font-weight:bold;">&#125;</span> -s <span style="color:#006600; font-weight:bold;">&#91;</span>OR<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RewriteCond %<span style="color:#006600; font-weight:bold;">&#123;</span>REQUEST_FILENAME<span style="color:#006600; font-weight:bold;">&#125;</span> -l <span style="color:#006600; font-weight:bold;">&#91;</span>OR<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RewriteCond %<span style="color:#006600; font-weight:bold;">&#123;</span>REQUEST_FILENAME<span style="color:#006600; font-weight:bold;">&#125;</span> -d</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RewriteRule ^.*$ - <span style="color:#006600; font-weight:bold;">&#91;</span>NC,L<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RewriteRule ^.*$ index.<span style="">php</span> <span style="color:#006600; font-weight:bold;">&#91;</span>NC,L<span style="color:#006600; font-weight:bold;">&#93;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Adentrándonos en la Estructura de Directorio</h3>
<h4>Configs</h4>
<p>Dentro del directorio configs, encontraremos un archivo llamado “<strong>application.ini</strong>”. Este archivo se utiliza para definir la configuración base del arranque de nuestro proyecto, <strong>el Boostrap</strong>. Veremos más adelante cómo podemos agregar recursos a la configuración del arranque, que son auto cargados por la aplicación cuando inicia. Lo fundamental es familiarizarnos con el archivo de configuración y se convertirá en uno de nuestros mejores aliados en ZF.<br />
La configuración por defecto se coloca en “<strong>application/configs/application.ini</strong>”, y contiene algunas directrices básicas:</p>
<div class="igBar"><span id="lcode-41"><a href="#" onclick="javascript:showPlainTxt('code-41'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-41">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">; application/configs/application.<span style="">ini</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>production<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">phpSettings.<span style="">display_startup_errors</span> = <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">phpSettings.<span style="">display_errors</span> = <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">includePaths.<span style="">library</span> = APPLICATION_PATH <span style="color:#CC0000;">"/../library"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">bootstrap.<span style="">path</span> = APPLICATION_PATH <span style="color:#CC0000;">"/Bootstrap.php"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">bootstrap.<span style="">class</span> = <span style="color:#CC0000;">"Bootstrap"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">frontController</span>.<span style="">controllerDirectory</span> = APPLICATION_PATH <span style="color:#CC0000;">"/controllers"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>staging : production<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>testing : production<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">phpSettings.<span style="">display_startup_errors</span> = <span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">phpSettings.<span style="">display_errors</span> = <span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>development : production<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">phpSettings.<span style="">display_startup_errors</span> = <span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">phpSettings.<span style="">display_errors</span> = <span style="color:#800000;color:#800000;">1</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>Controladores</h4>
<p>Dentro del directorio del controlador, se encuentran los archivos para cada controlador. Esto es algo que hemos visto muchas veces, así que no vamos a entrar en detalles. Al llegar a los módulos, no se olvide de anteponer el nombre de módulo, el prefijo,  al nombre de clase (es decir, Admin_IndexController).</p>
<h4>Modelos</h4>
<p>Dentro del directorio de modelos, creamos nuestras clases modelos, un modelo contiene la lógica de negocio, pero no está vinculada a un motor de almacenamiento. Esto significa básicamente que los modelos no son sólo aquellos que extiendan de la clase <em>Zend_Db_Table</em>, sino que también otras fuentes de datos como un archivo plano (CVS), un XML, Web Service, SOAP, alguna fuente de dato proveniente de algún ERP etc.</p>
<h4>Vistas</h4>
<p>El directorio de las vistas, básicamente nuestras plantillas de presentación XHTML y las clase Helper View.</p>
<h3>Añadiendo nuestras librerías</h3>
<p>Por ejemplo, supongamos que hemos escrito un par de componentes para procesar archivos planos CVS y otras librerías más (como procesamiento de imágenes con GD) y las llamamos <strong>Core </strong>(nuestro propio core), entonces las almacenamos dentro del directorio <strong>library </strong>y en el sub directorio Core. Digamos que queremos añadir estas, sólo tenemos que añadir la siguiente entrada en el <strong>application.ini</strong>:</p>
<div class="igBar"><span id="lcode-42"><a href="#" onclick="javascript:showPlainTxt('code-42'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-42">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">autoloaderNamespaces.<span style="">core</span> = <span style="color:#CC0000;">"Core_"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">autoloaderNamespaces.<span style="">otra</span>&nbsp; = <span style="color:#CC0000;">"OtraLibreria_"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">autoloaderNamespaces.<span style="">yotramas</span>&nbsp; = <span style="color:#CC0000;">"YOtraLibreriaMas_"</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Importante:</strong> desde nuestra aplicación, se espera que <em>autoloaderNamespaces </em>sea una matriz, razón por la cual <strong>necesitamos agregar una clave</strong>. Esto significa que podemos agregar múltiples bibliotecas personalizadas. Otro detalle a tener en cuenta es que hay que <strong>añadir un guión al final de su prefijo de la biblioteca</strong>. Tomando como ejemplo <em>OtraLibreria</em>, este hecho abre la puerta para las clases como <em>OtraLibreria_NombreDeClase</em>).</p>
<h3>Agregando módulos</h3>
<p>Perfecto, bueno y ¿Esto es todo? No, En realidad no… Como habrán notado, aun no tenemos un <strong>directorio de módulos</strong>. Así que vamos a cambiar eso y añadiremos nuestro primer módulo, llamado "admin".</p>
<div class="igBar"><span id="lcode-43"><a href="#" onclick="javascript:showPlainTxt('code-43'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-43">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$zf create module admin</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Creating the following module and artifacts:</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">………………….. </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Como pueden ver, crea un nuevo directorio llamado "<strong>modules</strong>" dentro del directorio “<strong>application</strong>”. Ahí se crea el directorio para el módulo "<strong>admin</strong>" con una estructura similar para el módulo como hemos descrito anteriormente.</p>
<p>Ahora vamos a crear un nuevo controlador para el módulo de modo que tengamos algo que mostrar en admin, quizás un saludo de bienvenida, esto lo hacemos manualmente como siempre lo hacemos.<br />
Ahora, si intentamos en el navegador, ejecutar el módulo <strong>admin</strong>, vamos a obtener un mensaje de error "<em>Message: Invalid controller specified (<strong>admin</strong>)</em>".</p>
<p>Entonces, ¿qué hicimos mal? Nada en realidad. Ya que nuestra aplicación aun no está lista. Ya que hemos creado nuestro primer módulo, ahora tenemos que decirle a la configuración “<strong>application.ini</strong>” que nuestro sistema debe tener la estructura modular de directorio, por lo tanto, vamos a abrir <strong>application.ini</strong> y agregaremos las siguientes líneas al final del bloque de producción:</p>
<div class="igBar"><span id="lcode-44"><a href="#" onclick="javascript:showPlainTxt('code-44'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-44">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">frontController</span>.<span style="">moduleDirectory</span> = APPLICATION_PATH <span style="color:#CC0000;">"/ modules"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">modules</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> resources.<span style="">modules</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora estamos en condiciones de ejecutar nuestro módulo en el navegador:<br />
http://localhost/proyecto-zf/public/admin/</p>
<h3>El Bootstrap</h3>
<p>La clase <strong>Bootstrap </strong>define que recursos y componentes que se deben inicializar. De forma predeterminada, el Front Controller es inicializado (<em>Zend_Controller_Front</em>), y configura por defecto el directorio “<strong>application/controllers/</strong>” para manejar los Controladores (Action Controllers).</p>
<div class="igBar"><span id="lphp-45"><a href="#" onclick="javascript:showPlainTxt('php-45'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-45">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> Bootstrap extends Zend_Application_Bootstrap_Bootstrap</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>En la clase <strong>Boostraps </strong>podemos incluir recursos para que estos sean inicializados cuando arranca la aplicación. Para ello debemos agregar métodos cuyo nombre debe comenzar con el carácter underscore [ _ ] seguido  de la palabra init (llamado el prefijo _init) y el nombre del recurso, comenzando este último en mayúscula y caracteres alfanuméricos.</p>
<p>Ejemplo: <em>_initNombreDelRecurso()</em>:</p>
<p>Veamos un ejemplo de una estructura típica de una clase Boostrap con <strong>Zend_Application</strong>:</p>
<div class="igBar"><span id="lphp-46"><a href="#" onclick="javascript:showPlainTxt('php-46'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-46">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> Bootstrap extends Zend_Application_Bootstrap_Bootstrap</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; protected <span style="color:#000000; font-weight:bold;">function</span> _initFoo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// ...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; protected <span style="color:#000000; font-weight:bold;">function</span> _initBar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// ...</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; protected <span style="color:#000000; font-weight:bold;">function</span> _initBaz<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// ...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para arrancar sólo el método _initFoo (), hacemos lo siguiente:</p>
<div class="igBar"><span id="lphp-47"><a href="#" onclick="javascript:showPlainTxt('php-47'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-47">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$bootstrap</span>-&gt;<span style="color:#006600;">bootstrap</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'foo'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para arrancar los  métodos _initFoo () e _initBar (), hacemos lo siguiente:</p>
<div class="igBar"><span id="lphp-48"><a href="#" onclick="javascript:showPlainTxt('php-48'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-48">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$bootstrap</span>-&gt;<span style="color:#006600;">bootstrap</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'foo'</span>, <span style="color:#FF0000;">'bar'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para inicializar todos los métodos de los recursos en el arranque, llamaremos a bootstrap() sin argumentos:</p>
<div class="igBar"><span id="lphp-49"><a href="#" onclick="javascript:showPlainTxt('php-49'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-49">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$bootstrap</span>-&gt;<span style="color:#006600;">bootstrap</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Este último es el más común y es el que observaremos en nuestro archivo de arranque index.php ubicado dentro del directorio “<strong>public</strong>”.</p>
<p>Veamos un ejemplo más en concreto, ahora agregaremos un recurso para inicializar el objeto vista, el cual queremos poder asignarle el HTML DocType y un valor por defecto al título HTML del sitio.<br />
Esto puede ser implementado editando nuestra clase Bootstrap para agregar el método <em>_initView()</em>, veamos cómo a continuación:<br />
?</p>
<div class="igBar"><span id="lphp-50"><a href="#" onclick="javascript:showPlainTxt('php-50'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-50">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> Bootstrap extends Zend_Application_Bootstrap_Bootstrap</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; protected <span style="color:#000000; font-weight:bold;">function</span> _initView<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Inicializamos el objeto vista</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$view</span> = <span style="color:#000000; font-weight:bold;">new</span> Zend_View<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$view</span>-&gt;<span style="color:#006600;">doctype</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'XHTML1_STRICT'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$view</span>-&gt;<span style="color:#006600;">headTitle</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'My First Zend Framework Application'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Agregamos la vista al ViewRenderer</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$viewRenderer</span> = Zend_Controller_Action_HelperBroker::<span style="color:#006600;">getStaticHelper</span><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'ViewRenderer'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$viewRenderer</span>-&gt;<span style="color:#006600;">setView</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$view</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// Retornamos siempre el objeto recurso, en este caso la vista</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// De esta manera el recurso será almacenado dentro del contenedor del Bootstrap</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$view</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Este método se ejecutará automáticamente cuando se arranque la aplicación, y asegurará que nuestro objeto vista sea inicializado de acuerdo a la necesidad de nuestra aplicación.<br />
De esta manera podríamos tener un método _initXXXX para cada uno de nuestros recursos que queramos inicializar, como por ejemplo:</p>
<ul>
<li>_initConfig();</li>
<li>_initLog();</li>
<li>_initEnvironment();</li>
<li>_initLocale();</li>
<li>_initMail();</li>
<li>_initConnection();</li>
<li>_initLayout();</li>
</ul>
<p>Este tipo de recursos son los llamados personalizados dentro de la clase Bootstrap, por lo tanto somos nosotros quienes tenemos que implementarlo según lo que necesitemos que se inicialice en nuestra aplicación.<br />
?<br />
Luego, para obtener un recurso tenemos que hacerlo de las siguientes formas:</p>
<p><strong>Dentro de la Clase Boostrap</strong></p>
<div class="igBar"><span id="lphp-51"><a href="#" onclick="javascript:showPlainTxt('php-51'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-51">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$view</span> = <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">getResource</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'view'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Dentro de Algún Controlador</strong></p>
<div class="igBar"><span id="lphp-52"><a href="#" onclick="javascript:showPlainTxt('php-52'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-52">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$bootstrap</span> = <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">getInvokeArg</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'bootstrap'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$view</span> = <span style="color:#0000FF;">$bootstrap</span>-&gt;<span style="color:#006600;">getResource</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'view'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para asegurarnos que el contenedor de Boostrap contiene al recursos, llamamos al método hasResource(string recurso):</p>
<div class="igBar"><span id="lphp-53"><a href="#" onclick="javascript:showPlainTxt('php-53'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-53">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$bootstrap</span>-&gt;<span style="color:#006600;">hasResource</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'view'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$view</span> = <span style="color:#0000FF;">$bootstrap</span>-&gt;<span style="color:#006600;">getResource</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'view'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora tenemos otras formas de agregar recursos y estos ya están implementados implícitamente dentro de <strong>Zend_Application</strong> (por defecto), es decir ya están disponibles y listos para usar, gracias a Zend Framework, estos son los llamados “<strong>Plugins de Recursos Disponibles</strong>”.</p>
<p>Para utilizarlos sólo tenemos que configurarlo (activarlo) dentro del archivo de configuración “<strong>application.ini</strong>” (lo que veremos a continuación).</p>
<h3>Plugins de Recursos Disponibles</h3>
<h4>Resource Layout</h4>
<p>Unos de los recursos estándar que nos provee <em>Zend Application</em> es el Recurso de Layout. Para activar este recurso sólo tenemos que configurar de manera adecuada nuestro archivo de configuración “<strong>application.ini</strong>” definiendo los valores para la instancia del objeto <em>Zend Layout</em>, nombre del layout por defecto y el path:</p>
<p>Entonces dentro de la etiqueta production agregamos lo siguiente:</p>
<div class="igBar"><span id="lcode-54"><a href="#" onclick="javascript:showPlainTxt('code-54'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-54">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">; Agregamos las siguientes lineas:</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">layout</span>.<span style="">layout</span> = <span style="color:#CC0000;">"layout"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">layout</span>.<span style="">layoutPath</span> = APPLICATION_PATH <span style="color:#CC0000;">"/layouts/scripts"</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Luego tenemos que crear nuestro archivo de layout dentro de la ruta especificada en la configuración “application/layouts/scripts/” el cual llamaremos layout.phtml:</p>
<div class="igBar"><span id="lphp-55"><a href="#" onclick="javascript:showPlainTxt('php-55'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-55">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">doctype</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;html&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;head&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">headTitle</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">headLink</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">headStyle</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">headScript</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/head&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;body&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">layout</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>-&gt;<span style="color:#006600;">content</span> <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/body&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/html&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>Resource View</h4>
<p>También Zend Application nos provee de un recurso para la vista, solo tenemos que agregar unas líneas en el archivo application.ini como se muestra a continuación:</p>
<div class="igBar"><span id="lcode-56"><a href="#" onclick="javascript:showPlainTxt('code-56'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-56">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">view</span>.<span style="">encoding</span> = <span style="color:#CC0000;">"UTF-8"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">view</span>.<span style="">basePath</span> = APPLICATION_PATH <span style="color:#CC0000;">"/views/scripts"</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>Resource Db</h4>
<p>Tampoco se podía quedar atrás la inicialización de la conexión a las base de datos.<br />
<em>Zend_Application_Resource_Db</em> inicializará un adaptador <em>Zend_Db</em> basado en las configuraciones asignadas en <strong>application.ini</strong>. De forma predeterminada, éste también asigna el adaptador por defecto del adaptador que debe utilizar <em>Zend_Db_Table</em>:</p>
<div class="igBar"><span id="lcode-57"><a href="#" onclick="javascript:showPlainTxt('code-57'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-57">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>production<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">db</span>.<span style="">adapter</span> = <span style="color:#CC0000;">"pdo_mysql"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">db</span>.<span style="">params</span>.<span style="">host</span> = <span style="color:#CC0000;">"localhost"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">db</span>.<span style="">params</span>.<span style="">username</span> = <span style="color:#CC0000;">"webuser"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">db</span>.<span style="">params</span>.<span style="">password</span> = <span style="color:#CC0000;">"XXXXXXX"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">db</span>.<span style="">params</span>.<span style="">dbname</span> = <span style="color:#CC0000;">"test"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">db</span>.<span style="">isDefaultTableAdapter</span> = true </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h4>Resource Frontcontroller</h4>
<p>Probablemente el recurso más importante y común que se carga con <em>Zend_Application</em> será el recurso Front Controller, que nos proporciona la capacidad de configurar <em>Zend_Controller_Front</em>.<br />
Este recurso proporciona la capacidad de establecer parámetros del front controller, especificar los plugins a inicializar, y mucho más. </p>
<p>Una vez inicializado, el recurso asigna la propiedad $frontController del arranque a la instancia <em>Zend_Controller_Front</em>.</p>
<div class="igBar"><span id="lcode-58"><a href="#" onclick="javascript:showPlainTxt('code-58'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-58">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>production<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">frontController</span>.<span style="">controllerDirectory</span> = APPLICATION_PATH <span style="color:#CC0000;">"/controllers"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">frontController</span>.<span style="">moduleControllerDirectoryName</span> = <span style="color:#CC0000;">"actions"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">frontController</span>.<span style="">moduleDirectory</span> = APPLICATION_PATH <span style="color:#CC0000;">"/modules"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">frontController</span>.<span style="">defaultControllerName</span> = <span style="color:#CC0000;">"site"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">frontController</span>.<span style="">defaultAction</span> = <span style="color:#CC0000;">"home"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">frontController</span>.<span style="">defaultModule</span> = <span style="color:#CC0000;">"static"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">frontController</span>.<span style="">baseUrl</span> = <span style="color:#CC0000;">"/subdir"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">frontController</span>.<span style="">plugins</span>.<span style="">foo</span> = <span style="color:#CC0000;">"My_Plugin_Foo"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">frontController</span>.<span style="">plugins</span>.<span style="">bar</span> = <span style="color:#CC0000;">"My_Plugin_Bar"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resources.<span style="">frontController</span>.<span style="">env</span> = APPLICATION_ENV </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Nos adentramos en el funcionamiento de <em>Zend Application</em>, las funcionalidades que puede involucrar, como así también algunas de las posibilidades para ampliarlo, creando un archivo de configuración o iniciando un sistema de logger con <em>Zend_Log</em>, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://bolsadeideas.cl/zsamer/2009/08/bootstrapping-con-zend-application/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP 5.3.0 Liberado!</title>
		<link>http://bolsadeideas.cl/zsamer/2009/06/php-530-liberado/</link>
		<comments>http://bolsadeideas.cl/zsamer/2009/06/php-530-liberado/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 13:32:00 +0000</pubDate>
		<dc:creator>zsamer</dc:creator>
		
		<category><![CDATA[PHP5]]></category>

		<guid isPermaLink="false">http://bolsadeideas.cl/zsamer/?p=67</guid>
		<description><![CDATA[Lo prometido es cumplido, tal como anunciaron hace tres días, el equipo de PHP ha liberado la versión de PHP 5.3.0. Esta versión es una mejora importante en la serie 5.X, que incluye un gran número de nuevas características y corrección de errores.
Algunas de las nuevas características clave incluyen: namespaces, late static binding, closures, opcional [...]]]></description>
			<content:encoded><![CDATA[<p>Lo prometido es cumplido, tal como anunciaron hace tres días, el equipo de PHP ha liberado la versión de <a href="http://php.net/downloads.php#v5.3.0">PHP 5.3.0</a>. Esta versión es una mejora importante en la serie 5.X, que incluye un gran número de nuevas características y corrección de errores.</p>
<p>Algunas de las nuevas características clave incluyen: namespaces, late static binding, closures, opcional garbage collection para eliminar objetos que no están siendo utilizados/referenciados, las nuevas extensiones (como ext / far, ext / intl y ext / FileInfo), más de 140 correcciones de errores y mucho más.</p>
<p>También tenemos una completa <a href="http://php.net/migration53">guía de emigración desde la versión PHP 5.2</a>.</p>
<p>Más detalles sobre la liberación de <a href="http://php.net/releases/5_3_0.php">PHP 5.3.0 se puede encontrar aquí</a>.</p>
<p><a href="http://php.net/downloads.php#v5.3.0">Descargar PHP 5.3.0</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bolsadeideas.cl/zsamer/2009/06/php-530-liberado/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP 5.3 el próximo 30 de Junio</title>
		<link>http://bolsadeideas.cl/zsamer/2009/06/php-53-el-proximo-30-de-junio/</link>
		<comments>http://bolsadeideas.cl/zsamer/2009/06/php-53-el-proximo-30-de-junio/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 17:03:23 +0000</pubDate>
		<dc:creator>zsamer</dc:creator>
		
		<category><![CDATA[PHP5]]></category>

		<category><![CDATA[Patron de Diseño]]></category>

		<guid isPermaLink="false">http://bolsadeideas.cl/zsamer/?p=66</guid>
		<description><![CDATA[Una muy alentadora noticia de la larga espera de todos nosotros desarrolladores PHP5.
Finalmente la larga espera ya tiene un fin: los desarrolladores de PHP anunciaron en la lista de php.internals que postergaron el lanzamiento de la versión definitiva del anticipado PHP 5.3.0 hasta el Martes 30 de Junio, con sus Mirrors comenzando a actualizarse a [...]]]></description>
			<content:encoded><![CDATA[<p>Una muy alentadora noticia de la larga espera de todos nosotros desarrolladores PHP5.</p>
<p>Finalmente la larga espera ya tiene un fin: los desarrolladores de PHP <a href="http://news.php.net/php.internals/44454">anunciaron en la lista de php.internals</a> que postergaron el lanzamiento de la versión definitiva del anticipado <strong>PHP 5.3.0</strong> hasta el <strong>Martes 30 de Junio</strong>, con sus Mirrors comenzando a actualizarse a partir de próximo Lunes.</p>
<p>Todavía se están agregando parches de último momento, como los que corrigen problemas con el driver nativo de MySQL, las funciones de fecha y la inicialización en sistemas Sparc. Todoas las demás correcciones de errores <em>no-críticos</em> se postergarán hasta la siguiente versión <strong>5.3.1</strong>, todavía sin fecha de lanzamiento.</p>
<p><strong>PHP 5.3.0</strong> incluye importantísimas novedades, como por ejemplo: <a href="http://es.wikipedia.org/wiki/Namespace">Namespaces</a> (espacios de nombre), <a href="http://docs.php.net/functions.anonymous">funciones anónimas</a> (<em>lambda</em> y <em>closures</em>), <a href="http://php.net/mysqli.mysqlnd">driver nativo de MySQL</a>, soporte mejorado para Windows, <a href="http://www.ibm.com/developerworks/opensource/library/os-php-5.3new4/index.html?ca=dgr-lnxw16PHP5.3-Phar&amp;S_TACT=105AGX59&amp;S_CMP=grsitelnxw16">archivos Phar</a> (similares a los JAR de Java) y hasta el polémico <a href="http://php.net/goto">operador <code>goto</code></a>.</p>
<p>Fuente: <a href="http://www.vivaphp.com.ar/eventos/php-5.3.0-el-30-06-09" target="_blank">VivaPHP</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bolsadeideas.cl/zsamer/2009/06/php-53-el-proximo-30-de-junio/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
