<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Zendcasts Forum / Development Issues]]></title>
		<link>http://www.zendcasts.com/forum/index.php</link>
		<description><![CDATA[The most recent topics at Zendcasts Forum.]]></description>
		<lastBuildDate>Wed, 16 Nov 2011 22:18:15 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Zend_Framework and Apache mod_userdir]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=479&amp;action=new</link>
			<description><![CDATA[<p>Ok, finally solved this myself. My solution required three steps.</p><p>1. Use the Zend Framework&#039;s application.ini to change the base URL<br /></p><div class="codebox"><pre><code>[development : production]
# Debug output
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

# Front Controller
resources.frontController.params.displayExceptions = 1
resources.frontController.baseUrl = &quot;/~user/project&quot;</code></pre></div><p>2. Create a .htaccess for the top level of your project (e.g., devserver/~user/project/). It includes a RewriteRule and RewriteBase to automagically push all requests to the public/ directory so Zend Framework can work its magic.<br /></p><div class="codebox"><pre><code>SetEnv APPLICATION_ENV &quot;development&quot;
&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
    RewriteBase /~user/project
    RewriteRule ^(.*)$ public/$0 [L]
&lt;/IfModule&gt;</code></pre></div><p>3. Modify the default Zend Framework .htaccess file in the public/ directory of your Zend Framework project (e.g. devserver/~user/project/public/). You&#039;re adding a RewriteBase to this as well. This helps keep any links in the project from trying to drop down to the main project path (e.g. devserver/~user/project/).<br /></p><div class="codebox"><pre><code>SetEnv APPLICATION_ENV &quot;development&quot;
RewriteEngine On
RewriteBase /~user/project
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (stevec)]]></author>
			<pubDate>Wed, 16 Nov 2011 22:18:15 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=479&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Expanding Zend Form Element File]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=478&amp;action=new</link>
			<description><![CDATA[<p>I have found a serious limitation in the above class and i want to extend it to add new useful (i would say basic) features.<br />At moment, the File element simply shows the standard file upload box. Nothing more.</p><p>The problem is: what happens if a users uploads a file? Absolutely nothing.</p><p>The user will never know if a file was uploaded for that record nor he will be able to delete the file if he no longer wants it.</p><p>So i tried creating a custom form element, extending Zend Form Element File and redefining the formFile view helper... but, for unknown reasons, $helper variable is never used and formFile view helper is always called.</p><p>It looks like that the Zend Form Decorator File is messing up things and calling formFile view helper directly but that code is beyond my understanding.</p><p>Has anyone ever managed to solve this problem?</p><p>Thanks for your help.</p>]]></description>
			<author><![CDATA[dummy@example.com (Miles8of9)]]></author>
			<pubDate>Tue, 11 Oct 2011 13:39:26 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=478&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Zend Paginator & Doctrine Records]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=476&amp;action=new</link>
			<description><![CDATA[<p>Here is a snittet to use with Zend Paginator &amp; Doctrine Records (Models)</p><div class="quotebox"><cite>App_Paginator_Adapter_Doctrine wrote:</cite><blockquote><div><p>&lt;?php</p><p>class App_Paginator_Adapter_Doctrine<br />&#160; &#160; implements Zend_Paginator_Adapter_Interface<br />{<br />&#160; &#160; protected $_select;<br />&#160; &#160; <br />&#160; &#160; public function __construct( Doctrine_Query $select )<br />&#160; &#160; {<br />&#160; &#160; &#160; &#160; $this-&gt;_select = $select;<br />&#160; &#160; }<br />&#160; &#160; <br />&#160; &#160; public function getItems($offset, $itemCountPerPage)<br />&#160; &#160; {<br />&#160; &#160; &#160; &#160; return $this-&gt;_select-&gt;offset($offset)-&gt;limit($itemCountPerPage)-&gt;execute();<br />&#160; &#160; }<br />&#160; &#160; <br />&#160; &#160; public function count()<br />&#160; &#160; {<br />&#160; &#160; &#160; &#160; return $this-&gt;_select-&gt;count();<br />&#160; &#160; }<br />}</p></div></blockquote></div><div class="quotebox"><cite>IndexController wrote:</cite><blockquote><div><p>public function indexAction()<br />&#160; &#160; {<br />&#160; &#160; &#160; &#160; /**<br />&#160; &#160; &#160; &#160; &#160;* Paginator<br />&#160; &#160; &#160; &#160; &#160;*/<br />&#160; &#160; &#160; &#160; $adapter = new App_Paginator_Adapter_Doctrine(Doctrine_Query::create()-&gt;select()-&gt;from(&#039;Model_Foo f&#039;));<br />&#160; &#160; &#160; &#160; $paginator = new Zend_Paginator( $adapter );<br />&#160; &#160; &#160; &#160; $paginator-&gt;setItemCountPerPage( 5 )<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; -&gt;setCurrentPageNumber( $this-&gt;_getParam( &#039;page&#039;, 1 ) )<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; -&gt;setPageRange( 8 );</p><br /><p>&#160; &#160; &#160; &#160; $this-&gt;view-&gt;paginator = $paginator;<br />&#160; &#160; }</p></div></blockquote></div>]]></description>
			<author><![CDATA[dummy@example.com (Jarsäter)]]></author>
			<pubDate>Fri, 23 Sep 2011 11:26:22 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=476&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Tree structure from db]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=475&amp;action=new</link>
			<description><![CDATA[<p>Looking for a class/plugin or a good tutorial how to make a proper Tree structure with db.<br />I mean id and parentId structure that working well with Zend.</p>]]></description>
			<author><![CDATA[dummy@example.com (Skatan)]]></author>
			<pubDate>Tue, 13 Sep 2011 19:45:02 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=475&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[How can I do this?]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=456&amp;action=new</link>
			<description><![CDATA[<p>I need two similar routes like the following</p><p>;default/blog/catslug/postslug<br />routes.blogCatPost.type = &quot;Zend_Controller_Router_Route_Regex&quot;<br />routes.blogCatPost.route = &quot;blog/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)&quot;<br />routes.blogCatPost.defaults.module = default<br />routes.blogCatPost.defaults.controller = blog<br />routes.blogCatPost.defaults.action = post<br />routes.blogCatPost.map.catslug = 1<br />routes.blogCatPost.map.postslug = 2</p><br /><p>;default/blog/page/2<br />routes.blogPage.type = &quot;Zend_Controller_Router_Route_Regex&quot;<br />routes.blogPage.route = &quot;blog/page/(\d+)&quot;<br />routes.blogPage.defaults.module = default<br />routes.blogPage.defaults.controller = blog<br />routes.blogPage.defaults.action = index<br />routes.blogPage.map.page = 1<br />routes.blogPage.defaults.page = 1</p><br /><p>And Finally For this URL --&#160; <a href="http://tok.local/blog/page/2">http://tok.local/blog/page/2</a><br />Request Parameters:<br />array (<br />&#160; &#039;catslug&#039; =&gt; &#039;page&#039;,<br />&#160; &#039;postslug&#039; =&gt; &#039;2&#039;,<br />&#160; &#039;module&#039; =&gt; &#039;default&#039;,<br />&#160; &#039;controller&#039; =&gt; &#039;blog&#039;,<br />&#160; &#039;action&#039; =&gt; &#039;post&#039;,<br />)</p><p>It&#039;s not working. I can&#039;t notice whats wrong in it. How to solve this? Please someone help me out ...</p>]]></description>
			<author><![CDATA[dummy@example.com (samik)]]></author>
			<pubDate>Sun, 31 Jul 2011 20:02:48 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=456&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Run Zend Framework MVC without virtual host]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=453&amp;action=new</link>
			<description><![CDATA[<p>Read this post from Rob Allen&#039;s<br /><a href="http://akrabat.com/zend-framework/zend-framework-on-a-shared-host/">http://akrabat.com/zend-framework/zend- … ared-host/</a></p>]]></description>
			<author><![CDATA[dummy@example.com (rpsimao)]]></author>
			<pubDate>Sat, 30 Jul 2011 14:35:33 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=453&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[important]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=440&amp;action=new</link>
			<description><![CDATA[<p>i want to use ajax to make copy link button which copy url and u can paste it in any browser i need to use ajax request send from client to server and server response with url append id to it anyone can help me ?</p>]]></description>
			<author><![CDATA[dummy@example.com (mahmoud taha)]]></author>
			<pubDate>Sat, 23 Jul 2011 11:27:24 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=440&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Custom Zend_Controller Routes]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=435&amp;action=new</link>
			<description><![CDATA[<p>I followed Jon tutorial on custom routes, everything work fine except when I have more complex routes I don&#039;t know how to handle them in my bootstrap.</p><p>My application has a search engine, and I have params in the URL<br />e.g.: Domaine.com/en/listing/search/city/1<br />&#160; &#160; &#160; &#160; Domaine.com/en/listing/search/city/1/sector/2</p><p>How do I create custom routes for all the possibilities in my URL?</p><p>Thank you,<br />Simon</p>]]></description>
			<author><![CDATA[dummy@example.com (Xherdas)]]></author>
			<pubDate>Wed, 20 Jul 2011 19:53:05 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=435&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Custom Router to manage a complex URL]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=434&amp;action=new</link>
			<description><![CDATA[<p>Please help me solve this routing problem. The URL is like &quot;domain.com/a/b/c/d&quot;, where controller=index and action=post. Here the last pathBit is the post_slug to be searched from the database. I have created the router, but couldn&#039;t use it appropriately. ZF is taking the first pathBit as controller name and giving an error &quot;controller not found&quot;. Following is what I have done yet.</p><p>class Layzend_Route_Post extends Zend_Controller_Router_Route<br />{</p><p>&#160; &#160; public function __construct($route, $defaults = array())<br />&#160; &#160; {<br />&#160; &#160; &#160; &#160; $this-&gt;_route = trim($route, $this-&gt;_urlDelimiter);<br />&#160; &#160; &#160; &#160; $this-&gt;_defaults = (array)$defaults;<br />&#160; &#160; }</p><p>&#160; &#160; public function match($path, $partial = false)<br />&#160; &#160; {<br />&#160; &#160; &#160; &#160; if ($path instanceof Zend_Controller_Request_Http) {<br />&#160; &#160; &#160; &#160; &#160; &#160; $path = $path-&gt;getPathInfo();<br />&#160; &#160; &#160; &#160; }</p><p>&#160; &#160; &#160; &#160; $path = trim($path, $this-&gt;_urlDelimiter);<br />&#160; &#160; &#160; &#160; $pathBits = explode($this-&gt;_urlDelimiter, $path);<br />&#160; &#160; &#160; &#160; <br />&#160; &#160; &#160; &#160; if (count($pathBits) &lt; 1) {<br />&#160; &#160; &#160; &#160; &#160; &#160; return false;<br />&#160; &#160; &#160; &#160; }<br />&#160; &#160; &#160; &#160; <br />&#160; &#160; &#160; &#160; $max = sizeof($pathBits) - 1;<br />&#160; &#160; &#160; &#160; $slug = $pathBits[$max];<br />&#160; &#160; &#160; &#160; <br />&#160; &#160; &#160; &#160; $pt = new Application_Model_Mapper_Post();<br />&#160; &#160; &#160; &#160; $rec = $pt-&gt;findBy(&#039;post_slug&#039;,$slug);<br />&#160; &#160; &#160; &#160; if($rec) <br />&#160; &#160; &#160; &#160; &#160; &#160; Zend_Registry::set(&#039;post&#039;, $rec);<br />&#160; &#160; &#160; &#160; else <br />&#160; &#160; &#160; &#160; &#160; &#160; return new Zend_Exception(404,&#039;Post not found&#039;);<br />&#160; &#160; &#160; &#160; <br />&#160; &#160; &#160; &#160; return false;<br />&#160; &#160; }<br />}</p><p>In my bootstrap I have coded - </p><p>protected function _initRouter()<br />&#160; &#160; {<br />&#160; &#160; &#160; &#160; $front = Zend_Controller_Front::getInstance();<br />&#160; &#160; &#160; &#160; $router = $front-&gt;getRouter();<br />&#160; &#160; &#160; &#160; $router-&gt;addRoute(&#039;post&#039;, new Layzend_Route_Post(&#039;path&#039;, <br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;array(&#039;module&#039; =&gt; &#039;default&#039;,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#039;controller&#039; =&gt; &#039;index&#039;,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#039;action&#039; =&gt; &#039;post&#039;)));<br />&#160; &#160; }</p><br /><p>Please suggest me any solve. I have searched the web with no specific result.</p>]]></description>
			<author><![CDATA[dummy@example.com (samik)]]></author>
			<pubDate>Wed, 20 Jul 2011 09:10:29 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=434&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[ZF 1.11 doctrine2 YAML instead of PHP classes]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=417&amp;action=new</link>
			<description><![CDATA[<p>Can someone tell me what i need to change in the zendcast 68 code to make it work with yaml files instead of PHP classes?</p><p>thanks!</p>]]></description>
			<author><![CDATA[dummy@example.com (fjskmdl)]]></author>
			<pubDate>Wed, 06 Jul 2011 16:26:03 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=417&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Configuring PHPUnit and phpunit.xml --  'PHPUnit_Framework_Exception']]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=382&amp;action=new</link>
			<description><![CDATA[<p>Im posting this for other people that might need to search for some answers.</p><p>&#160; I had missed including the require_once &#039;ControllerTestCase.php&#039; in my bootstrap.&#160; After I added that things started to work.&#160; It seems very simple, and to add to this the name of your test suite shouldn&#039;t matter.&#160; You can name that whatever you like.&#160; Though if you boot strap your application before including ControllerTestCase.php it takes the name of your test suite and uses it as the file it thinks its looking for.&#160; After I included ControllerTestCase.php I could go back and name my test suite whatever I wanted.</p>]]></description>
			<author><![CDATA[dummy@example.com (lumberjacked)]]></author>
			<pubDate>Thu, 09 Jun 2011 16:57:20 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=382&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Hi!  First of all, thank you so much for doing this, Jon. I really enj]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=370&amp;action=new</link>
			<description><![CDATA[<p>Hi!</p><p>First of all, thank you so much for doing this, Jon. I really enjoy your screencasts and I wouldn&#039;t be as &quot;far&quot; (actually, I&#039;m still at the very beginning <img src="http://www.zendcasts.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /> in ZF development as I am right now.</p><p>So, my problem is this: I want to serve a mobile version of my site. In your screencast, you explained how to switch the layout file for this case, but that&#039;s not really enough in my case; I would like to use a different layout file and different view scripts in the mobile version, but the same controllers. Also, I want the mobile site to be accessible via m.domain.com.</p><p>I figured I&#039;d just use Zend_Controller_Router_Route_Hostname to switch to a different module called &#039;mobile&#039;, but this way I&#039;d have to use separate controllers too, right?</p><p>(Since I don&#039;t know the ZF from the ground up, but rather bits and pieces from screencasts and tutorials, I get stuck in stuff like that all the time. Now, I can&#039;t stand people who are trying to learn things this way (copy/pasting code and then fiddling around with it instead of just learning it properly), but I really can&#039;t see any other way with the Zend Framework..)</p>]]></description>
			<author><![CDATA[dummy@example.com (nawazm007)]]></author>
			<pubDate>Thu, 26 May 2011 18:56:59 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=370&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Zend + Doctrine, Charset problems]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=271&amp;action=new</link>
			<description><![CDATA[<p>My table is is utf-8</p>]]></description>
			<author><![CDATA[dummy@example.com (Jarsäter)]]></author>
			<pubDate>Wed, 25 May 2011 06:34:59 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=271&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Set UL ID on Navigation]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=358&amp;action=new</link>
			<description><![CDATA[<p>I solved the problem with a partial liek this:</p><p>Partial<br /></p><div class="codebox"><pre><code>&lt;ul id=&quot;abHeaderNavbarSub&quot; class=&quot;&quot;&gt;
    {foreach $container page}
        {if $page-&gt;isVisible()}
            &lt;li {if $page-&gt;isActive()}class=&quot;abSel&quot;{/if}&gt;&lt;a href=&quot;{$page-&gt;getUri()}&quot; title=&quot;{$page-&gt;getLabel()}&quot;&gt;{utf8_decode($page)}&lt;/a&gt;&lt;/li&gt;
        {/if}
    {/foreach}
&lt;/ul&gt;</code></pre></div><div class="codebox"><pre><code>$navigation = $view-&gt;navigation()-&gt;menu();
$navigation-&gt;setPartial( array(&#039;partials/menuItem.tpl&#039;, &#039;default&#039;) );
$navigation = $navigation-&gt;render();</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Jarsäter)]]></author>
			<pubDate>Fri, 13 May 2011 10:55:34 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=358&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Need help to build the router for the following problem]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?id=325&amp;action=new</link>
			<description><![CDATA[<p>Hello, </p><p>we use zend .ini config file for routes and this look prety easy to me. <br />I would create a route like down bellow and than simply in controller call some model class which would do a query into database. You have a category and subcategory cool uri, so I think, it shouldn&#039;t be a problem.</p><p>You can see that we use a modules, so if you have a Zend application without modules, than just don&#039;t use the module part of the route <img src="http://www.zendcasts.com/forum/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>; --- catalog module route ---<br />routes.catalog.route = :categoryCoolUri/:subcategoryCoolUri/*<br />routes.catalog.defaults.module = catalog<br />routes.catalog.defaults.controller = index&#160; &#160; ;or some other controller<br />routes.catalog.defaults.action = index&#160; &#160; &#160; &#160; &#160;;or some other action</p>]]></description>
			<author><![CDATA[dummy@example.com (tomor)]]></author>
			<pubDate>Mon, 18 Apr 2011 11:41:00 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?id=325&amp;action=new</guid>
		</item>
	</channel>
</rss>

