<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP 4u Web developer - 代码的简化 &#187; Zend Framework</title>
	<atom:link href="http://php4u.co.uk/category/zend-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://php4u.co.uk</link>
	<description>PHP related blog, freelancer to hire!</description>
	<lastBuildDate>Fri, 27 Aug 2010 12:09:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Zend_Test_Client problem with GET parameters in path</title>
		<link>http://php4u.co.uk/2010/08/zend_test_client-problem-with-get-parameters-in-path/</link>
		<comments>http://php4u.co.uk/2010/08/zend_test_client-problem-with-get-parameters-in-path/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 15:19:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[restful]]></category>
		<category><![CDATA[zend_rest_client]]></category>

		<guid isPermaLink="false">http://php4u.co.uk/?p=155</guid>
		<description><![CDATA[Let&#8217;s say you want to send REST request to http://test.server.int/articles and your provider requires to send token parameter &#8211; but in URL So your final url will be http://test.server.int/articles?token=12345 My client looked like: $rest = new Zend_Rest_Client('http://test.server.int'); $rest-&#62;restGet('/articles?token=123', array('article' =&#62; '&#60;xml&#62;YOUR XML&#60;/xml&#62;')); Fatal error: Uncaught exception &#8216;Zend_Uri_Exception&#8217; with message &#8216;Path &#8220;/articles?token=123&#8243; is not a valid [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you want to send REST request to http://test.server.int/articles and your provider requires to send token parameter &#8211; but in URL</p>
<p>So your final url will be http://test.server.int/articles?token=12345</p>
<p>My client looked like:<br />
<code><br />
$rest = new Zend_Rest_Client('http://test.server.int');<br />
$rest-&gt;restGet('/articles?token=123', array('article' =&gt; '&lt;xml&gt;YOUR XML&lt;/xml&gt;'));<br />
</code><br />
Fatal error: Uncaught exception &#8216;Zend_Uri_Exception&#8217; with message &#8216;Path &#8220;/articles?token=123&#8243; is not a valid HTTP path&#8217;</p>
<p>Solution was simple &#8211; your get parameter must be part of URI, not PATH<br />
<code><br />
$rest = new Zend_Rest_Client('http://test.server.int?token=123');<br />
$rest-&gt;restGet('/articles', array('article' =&gt; '&lt;xml&gt;YOUR XML&lt;/xml&gt;'));<br />
</code></p>
<p>Why I didn&#8217;t put it into array of arguments? Because for POST request I still wanted to have token as GET param</p>
]]></content:encoded>
			<wfw:commentRss>http://php4u.co.uk/2010/08/zend_test_client-problem-with-get-parameters-in-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use PHP and PDO to connect to MS SQL Server (Zend Framework)</title>
		<link>http://php4u.co.uk/2010/06/use-php-and-pdo-to-connect-to-ms-sql-server-zend-framework/</link>
		<comments>http://php4u.co.uk/2010/06/use-php-and-pdo-to-connect-to-ms-sql-server-zend-framework/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 15:03:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Microsoft SQL]]></category>
		<category><![CDATA[PDO]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://php4u.co.uk/?p=126</guid>
		<description><![CDATA[Problems connecting to MS SQL server from Zend Framework? Message: The mssql driver is not currently installed Solution is simple Install pdo_mssql driver: (Ubuntu) ?View Code BASH#sudo apt-get install php5-sybase #sudo /etc/init.d/apache2 restart On Centos you need to install pdo_dblib (any problems check here) It will not reflect in phpinfo() page Trick is to setup [...]]]></description>
			<content:encoded><![CDATA[<p>Problems connecting to MS SQL server from Zend Framework?</p>
<p><strong>Message:</strong> The mssql driver is not currently installed</p>
<p>Solution is simple</p>
<p>Install pdo_mssql driver: (Ubuntu)</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p126code3'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1263"><td class="code" id="p126code3"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#sudo apt-get install php5-sybase</span>
<span style="color: #666666; font-style: italic;">#sudo /etc/init.d/apache2 restart</span></pre></td></tr></table></div>

<p>On Centos you need to install pdo_dblib (any problems check <a href="http://www.richardhyland.com/diary/2009/02/25/two-days-with-pdo-and-my-lack-of-faith-in-the-php-extension-developers/" target="_blank">here</a>)</p>
<p>It will not reflect in phpinfo() page</p>
<p>Trick is to setup connection properly:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p126code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1264"><td class="code" id="p126code4"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$dbAdapter</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Db_Adapter_Pdo_Mssql<span style="color: #009900;">&#40;</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
 <span style="color: #0000ff;">'host'</span>     <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'192.xxx.xxx.xxx'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// parklife</span>
 <span style="color: #0000ff;">'username'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'xxx'</span><span style="color: #339933;">,</span>
 <span style="color: #0000ff;">'password'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'xxx'</span><span style="color: #339933;">,</span>
 <span style="color: #0000ff;">'dbname'</span>   <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'xxx'</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'pdoType'</span>  <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span>  <span style="color: #0000ff;">'dblib'</span> <span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://php4u.co.uk/2010/06/use-php-and-pdo-to-connect-to-ms-sql-server-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend_db_table how to find row by multiple columns?</title>
		<link>http://php4u.co.uk/2009/05/zend_db_table-how-to-find-row-by-multiple-columns/</link>
		<comments>http://php4u.co.uk/2009/05/zend_db_table-how-to-find-row-by-multiple-columns/#comments</comments>
		<pubDate>Fri, 08 May 2009 15:36:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[mysql query]]></category>
		<category><![CDATA[zend_db_table]]></category>

		<guid isPermaLink="false">http://php4u.co.uk/?p=85</guid>
		<description><![CDATA[Maybe should dig more in ZF API, but found simple solution: class YourClass extends Zend_Db_Table_Abstract { public function findOneByParams(array $params) { // prepare query $query = $this-&#62;select(); // add our terms foreach ($params as $param =&#62; $value) { $query-&#62;where($param.&#039; = ?&#039;, $value); } // find row $row = $this-&#62;fetchRow($query); // return return $row; } }]]></description>
			<content:encoded><![CDATA[<p>Maybe should dig more in ZF API, but found simple solution:</p>
<p><code lang="php"><br />
class YourClass extends Zend_Db_Table_Abstract<br />
{</p>
<p>    public function findOneByParams(array $params)<br />
    {<br />
    	// prepare query<br />
      $query = $this-&gt;select();</p>
<p>    	// add our terms<br />
      foreach ($params as $param =&gt; $value)<br />
    	{<br />
    		$query-&gt;where($param.&#039; = ?&#039;, $value);<br />
    	}</p>
<p>    	// find row<br />
    	$row = $this-&gt;fetchRow($query);</p>
<p>    	// return<br />
      return $row;<br />
    }<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://php4u.co.uk/2009/05/zend_db_table-how-to-find-row-by-multiple-columns/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zend Framework on-line tutorials/documentation</title>
		<link>http://php4u.co.uk/2009/03/zend-framework-on-line-tutorialsdocumentation/</link>
		<comments>http://php4u.co.uk/2009/03/zend-framework-on-line-tutorialsdocumentation/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 10:06:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://php4u.co.uk/?p=66</guid>
		<description><![CDATA[Last time I was using ZF when it was something around 1.5, so I was quite shocked when downloaded version 1.7 and started to use it. Documentation is quite ok, when you know what you want to do, but of course it is better when someone else will explain. Found nice knowledge resource &#8211; http://robertbasic.com/blog/online-resources-for-zend-framework/]]></description>
			<content:encoded><![CDATA[<p>Last time I was using ZF when it was something around 1.5, so I was quite shocked when downloaded version 1.7 and started to use it.</p>
<p>Documentation is quite ok, when you know what you want to do, but of course it is better when someone else will explain.<br />
Found nice knowledge resource &#8211; <a title="Zend Framework resources" href="http://robertbasic.com/blog/online-resources-for-zend-framework/" target="_blank">http://robertbasic.com/blog/online-resources-for-zend-framework/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://php4u.co.uk/2009/03/zend-framework-on-line-tutorialsdocumentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML code in Zend Forms description</title>
		<link>http://php4u.co.uk/2009/03/html-code-in-zend-forms-description/</link>
		<comments>http://php4u.co.uk/2009/03/html-code-in-zend-forms-description/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 22:06:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[zend_form]]></category>

		<guid isPermaLink="false">http://php4u.co.uk/?p=43</guid>
		<description><![CDATA[If you want to use HTML as description in Zend Forms use : ?View Code PHP$name = new Zend_Form_Element_Text&#40;'fullname'&#41;; $name-&#38;gt;setLabel&#40;'Full name:'&#41;; $name-&#38;gt;setDescription&#40;'&#60;a class=&#34;thickbox&#34; title=&#34;Please choose customer&#34; href=&#34;/customers/indexajax?KeepThis=true&#38;amp;TB_iframe=true&#38;amp;height=600&#38;amp;width=1100&#34;&#62;Find customer&#60;/a&#62;'&#41;;]]></description>
			<content:encoded><![CDATA[<p>If you want to use HTML as description in Zend Forms use :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p43code6'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p436"><td class="code" id="p43code6"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Form_Element_Text<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'fullname'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$name</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setLabel<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Full name:'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$name</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>setDescription<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;a class=&quot;thickbox&quot; title=&quot;Please choose customer&quot; href=&quot;/customers/indexajax?KeepThis=true&amp;amp;TB_iframe=true&amp;amp;height=600&amp;amp;width=1100&quot;&gt;Find customer&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://php4u.co.uk/2009/03/html-code-in-zend-forms-description/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.758 seconds -->
