<?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>haohtml&#039;s blog &#187; mvc</title>
	<atom:link href="http://blog.haohtml.com/tag/mvc/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.haohtml.com</link>
	<description>haohtml&#039;s life and works</description>
	<lastBuildDate>Tue, 07 Feb 2012 13:56:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ZF框架中的MVC</title>
		<link>http://blog.haohtml.com/archives/1083</link>
		<comments>http://blog.haohtml.com/archives/1083#comments</comments>
		<pubDate>Mon, 02 Mar 2009 13:51:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=1083</guid>
		<description><![CDATA[<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="MVC模式的PHP实现" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F455&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1083">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/15/31169095.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC模式的PHP实现</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="编译php出错：error while loading shared libraries: libmysqlclient.so.18: cannot open shared object f" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F12479&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1083">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">编译php出错：error while loading shared libraries: libmysqlclient.so.18: cannot open shared object f</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="在安装php的make时候,出现错误&quot;chmod: cannot access `ext/phar/phar.phar': No such file or directory&quot;的解决办法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F12482&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1083">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">在安装php的make时候,出现错误&quot;chmod: cannot access `ext/phar/phar.phar': No such file or directory&quot;的解决办法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="404错误页面重定向 PHP使用HEADER头发送状态(Status)信息(一)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F3070&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1083">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/22/4028468.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">404错误页面重定向 PHP使用HEADER头发送状态(Status)信息(一)</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.haohtml.com/wp-content/uploads/2009/03/8f5c2e59-c194-407e-93e4-949ca16aa67a.bmp" rel="lightbox[1083]"><img class="alignnone size-medium wp-image-1084" title="php_zendframework_MVC" src="http://blog.haohtml.com/wp-content/uploads/2009/03/8f5c2e59-c194-407e-93e4-949ca16aa67a.bmp" alt="" /></a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="MVC模式的PHP实现" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F455&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1083">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/09/15/31169095.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">MVC模式的PHP实现</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="编译php出错：error while loading shared libraries: libmysqlclient.so.18: cannot open shared object f" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F12479&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1083">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">编译php出错：error while loading shared libraries: libmysqlclient.so.18: cannot open shared object f</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="在安装php的make时候,出现错误&quot;chmod: cannot access `ext/phar/phar.phar': No such file or directory&quot;的解决办法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F12482&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1083">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">在安装php的make时候,出现错误&quot;chmod: cannot access `ext/phar/phar.phar': No such file or directory&quot;的解决办法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="404错误页面重定向 PHP使用HEADER头发送状态(Status)信息(一)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F3070&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1083">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/22/4028468.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">404错误页面重定向 PHP使用HEADER头发送状态(Status)信息(一)</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/archives/1083/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7.11. 使用传统的模块目录结构 第 7 章 Zend_Controller</title>
		<link>http://blog.haohtml.com/archives/477</link>
		<comments>http://blog.haohtml.com/archives/477#comments</comments>
		<pubDate>Wed, 29 Oct 2008 04:47:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://blog.haohtml.com/?p=477</guid>
		<description><![CDATA[使用传统的模块目录结构:
  传统的模块目录结构允许你把不同的MVC应用程序分离成为独立的单元，并和不同的前端控制器配合再使用。示例一下这样的目录结构： <table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="7.6. 分发器 第 7 章 Zend_Controller" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F481&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F477">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">7.6. 分发器 第 7 章 Zend_Controller</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Zend Framework 配置笔记" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F312&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F477">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Zend Framework 配置笔记</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[教程]FreeBSD下nginx+fast-cgi+mysql+zend的实现（php-fpm和spawn-fcgi）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1133&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F477">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/07/21/18323627.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[教程]FreeBSD下nginx+fast-cgi+mysql+zend的实现（php-fpm和spawn-fcgi）</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Zend Framework 入门教程(简体中文1.5.x版）(2008/06/17更新)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1077&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F477">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Zend Framework 入门教程(简体中文1.5.x版）(2008/06/17更新)</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<div class="sect1" lang="zh-cn">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;">7.11. 使用传统的模块目录结构</h2>
</div>
</div>
</div>
<div class="sect2" lang="zh-cn">
<div class="titlepage">
<div>
<div>
<h3 class="title">7.11.1. 简介</h3>
</div>
</div>
</div>
<p>传统的模块目录结构允许你把不同的MVC应用程序分离成为独立的单元，并和不同的前端控制器配合再使用。示例一下这样的目录结构：</p>
<pre class="programlisting">docroot/
    index.php
application/
    default/
        controllers/
            IndexController.php
            FooController.php
        models/
        views/
            scripts/
                index/
                foo/
            helpers/
            filters/
    blog/
        controllers/
            IndexController.php
        models/
        views/
            scripts/
                index/
            helpers/
            filters/
    news/
        controllers/
            IndexController.php
            ListController.php
        models/
        views/
        views/
            scripts/
                index/
                list/
            helpers/
            filters/</pre>
<p>在这个范例中，模块名作为它所包含的控制器的前缀。上面的例子包含三个模块控制器：'Blog_IndexController' 'News_IndexController' 和'News_ListController'。也定义了两个全局控制器：'IndexController' 和 'FooController'。它们都将不需要命名空间前缀。这个目录结构在本章中用作为例子。</p>
<div class="note">
<table border="0" summary="Note: 在缺省模块中不用命名空间前缀">
<tbody>
<tr>
<td rowspan="2" width="25" align="center" valign="top"><img src="http://blog.haohtml.com/wp-admin/images/note.png" alt="[注意]" /></td>
<th align="left">在缺省模块中不用命名空间前缀</th>
</tr>
<tr>
<td align="left" valign="top">注意在缺省模块中，控制器不需要一个命名空间前缀。这样，在上例中，在缺省模块中的控制器不需要'Default_'这样的前缀－－根据它们的基本控制器名'IndexController' 和 'FooController'被简单地派遣。然而，命名空间前缀被用于所有其它模块。</td>
</tr>
</tbody>
</table>
</div>
<p>那么，你怎样用Zend Framework MVC组件来实现这样的目录结构？</p></div>
<div class="sect2" lang="zh-cn">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="zend.controller.modular.directories"></a>7.11.2. 指定模块控制器目录</h3>
</div>
</div>
</div>
<p>利用模块的第一步是来修改你如何在前端控制器指定控制器目录列表。在基本的MVC系列，传递数组或字符串给<code class="code">setControllerDirectory()</code>，或者传递路径给<code class="code">addControllerDirectory()</code>。当使用模块，你需要稍微修改对这些方法的调用。</p>
<p>用<code class="code">setControllerDirectory()</code>，你将需要传递一个关联数组和指定‘模块名/目录路径’的‘键/值’对。特殊的键<code class="code">default</code> 将被用作全局控制器（不需要模块命名空间）。所有条目应该包含指向一个单个路径的字符串键，并且<code class="code">default</code>键必须出现。例如：</p>
<pre class="programlisting">&lt;?php
$front-&gt;setControllerDirectory(array(
      'default' =&gt; '/path/to/application/controllers',
      'blog'    =&gt; '/path/to/application/blog/controllers'
));</pre>
<p><code class="code">addControllerDirectory()</code>将带有可选的第二个参数。当使用模块，传递模块名作为第二个参数；如果没有指定，路径将被加到<code class="code">default</code>命名空间。例如：</p>
<pre class="programlisting">&lt;?php
$front-&gt;addControllerDirectory('/path/to/application/news/controllers', 'news');</pre>
<p>把最好的保留到最后，指定模块的最容易的方法是整体来做，把所有模块放到一个通用的目录并使用相同的结构。这可以用<code class="code">addModuleDirectory()</code>来完成：</p>
<pre class="programlisting">&lt;?php
/**
 * Assuming the following directory structure:
 * application/
 *     modules/
 *         default/
 *             controllers/
 *         foo/
 *             controllers/
 *         bar/
 *             controllers/
 */
$front-&gt;addModuleDirectory('/path/to/application/modules');</pre>
<p>上面的例子将定义<code class="code">default</code>、<code class="code">foo</code> 和 <code class="code">bar</code>模块，每个都分别指向它们的模块的<code class="code">controllers</code>子目录。</p>
<p>你可以在模块中通过<code class="code">setModuleControllerDirectoryName()</code>来定制模块子目录：</p>
<pre class="programlisting">&lt;?php
/**
 * Change the controllers subdirectory to be 'con'
 * application/
 *     modules/
 *         default/
 *             con/
 *         foo/
 *             con/
 *         bar/
 *             con/
 */
$front-&gt;setModuleControllerDirectoryName('con');
$front-&gt;addModuleDirectory('/path/to/application/modules');</pre>
<div class="note">
<table border="0" summary="Note">
<tbody>
<tr>
<td rowspan="2" width="25" align="center" valign="top"><img src="http://blog.haohtml.com/wp-admin/images/note.png" alt="[注意]" /></td>
<th align="left">注意</th>
</tr>
<tr>
<td align="left" valign="top">你可以通过传递一个空值给<code class="code">setModuleControllerDirectoryName()</code>来指定在你的模块中没有控制器子目录。</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect2" lang="zh-cn">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="zend.controller.modular.router"></a>7.11.3. Routing to modules</h3>
</div>
</div>
</div>
<p>在<code class="code">Zend_Controller_Router_Rewrite</code>中缺省的路由是一个<code class="code">Zend_Controller_Router_Route_Module</code>类型的对象。这个路由使用下面路由计划之一：</p>
<div class="itemizedlist">
<ul type="disc">
<li><code class="code">:module/:controller/:action/*</code></li>
<li><code class="code">:controller/:action/*</code></li>
</ul>
</div>
<p>换句话说，它将自己或通过先前的模块来匹配控制器和动作。匹配规则指定一个模块将只匹配在传递给前端控制器和派遣器的控制器目录数组中存在同名的键。</p></div>
<div class="sect2" lang="zh-cn">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="zend.controller.modular.defaultcontroller"></a>7.11.4. 模块或全局缺省控制器</h3>
</div>
</div>
</div>
<p>在缺省的路由器中，如果在URL中没有指定控制器，缺省控制器就被使用（<code class="code">IndexController</code>，除非另外要求）。对于模块控制器，如果一个模块被指定但没有控制器，派遣器首先寻找在这个模块路径中的缺省控制器，然后回到在'default'、全局、命名空间中发现的缺省控制器。</p>
<p>如果你总愿意缺省到全局命名空间，在前端控制器中设置<code class="code">useDefaultControllerAlways</code> 参数：</p>
<pre class="programlisting">&lt;?php
$front-&gt;setParam('useDefaultControllerAlways', true);</pre>
</div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="7.6. 分发器 第 7 章 Zend_Controller" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F481&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F477">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">7.6. 分发器 第 7 章 Zend_Controller</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Zend Framework 配置笔记" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F312&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F477">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Zend Framework 配置笔记</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[教程]FreeBSD下nginx+fast-cgi+mysql+zend的实现（php-fpm和spawn-fcgi）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1133&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F477">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/07/21/18323627.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[教程]FreeBSD下nginx+fast-cgi+mysql+zend的实现（php-fpm和spawn-fcgi）</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Zend Framework 入门教程(简体中文1.5.x版）(2008/06/17更新)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1077&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F477">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Zend Framework 入门教程(简体中文1.5.x版）(2008/06/17更新)</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/archives/477/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MVC模式的PHP实现</title>
		<link>http://blog.haohtml.com/archives/455</link>
		<comments>http://blog.haohtml.com/archives/455#comments</comments>
		<pubDate>Wed, 22 Oct 2008 04:56:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[程序开发]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://haohtml.com/wp/?p=455</guid>
		<description><![CDATA[MVC模式在网站架构中十分常见。它允许我们建立一个三层结构的应用程式，从代码中分离出有用的层，帮助设计师和开发者协同工作以及提高我们维护和扩展既有程式的能力。
视图（View）

“视图”主要指我们送到Web浏览器的最终结果??比如我们的脚本生成的HTML。当说到视图时，很多人想到的是模版，但是把模板方案叫做视图的正确性是值得怀疑的。

对视图来说，最重要的事情可能是它应该是“自我意识（self aware）”的，视图被渲染（render）时，视图的元素能意识到自己在更大框架中的角色。

以XML为例，可以说XML在被解析时，DOM API有着这样的认知??一个DOM树里的节点知道它在哪里和它包含了什么。 （当一个XML文档中的节点用SAX解析时只有当解析到该节点时它才有意义。）<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="ZF框架中的MVC" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1083&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F455">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/22/4027667.bmp" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">ZF框架中的MVC</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="编译php出错：error while loading shared libraries: libmysqlclient.so.18: cannot open shared object f" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F12479&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F455">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">编译php出错：error while loading shared libraries: libmysqlclient.so.18: cannot open shared object f</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="在安装php的make时候,出现错误&quot;chmod: cannot access `ext/phar/phar.phar': No such file or directory&quot;的解决办法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F12482&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F455">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">在安装php的make时候,出现错误&quot;chmod: cannot access `ext/phar/phar.phar': No such file or directory&quot;的解决办法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="PHP 输入／输出流" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F5123&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F455">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PHP 输入／输出流</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>作者:Harry Fuecks 翻译：Easy Chen </p>
<blockquote><p>MVC模式在网站架构中十分常见。它允许我们建立一个三层结构的应用程式，从代码中分离出有用的层，帮助设计师和开发者协同工作以及提高我们维护和扩展既有程式的能力。</p></blockquote>
<p><strong>视图（View）</strong></p>
<p>“视图”主要指我们送到Web浏览器的最终结果??比如我们的脚本生成的HTML。当说到视图时，很多人想到的是模版，但是把模板方案叫做视图的正确性是值得怀疑的。</p>
<p>对视图来说，最重要的事情可能是它应该是“自我意识（self aware）”的，视图被渲染（render）时，视图的元素能意识到自己在更大框架中的角色。</p>
<p>以XML为例，可以说XML在被解析时，DOM API有着这样的认知??一个DOM树里的节点知道它在哪里和它包含了什么。 （当一个XML文档中的节点用SAX解析时只有当解析到该节点时它才有意义。）</p>
<p>绝大多数模板方案使用简单的过程语言和这样的模板标签：</p>
<pre class="php">&lt;p&gt;{some_text}&lt;/p&gt;
&lt;p&gt;{some_more_text}&lt;/p&gt;</pre>
<p>它们在文档中没有意义，它们代表的意义只是PHP将用其他的东西来替换它。</p>
<p>如果你同意这种对视图的松散描述，你也就会同意绝大多数模板方案并没有有效的分离视图和模型。模板标签将被替换成什么存放在模型中。</p>
<p>在你实现视图时问自己几个问题：“全体视图的替换容易吗？”“实现一个新视图要多久？” “能很容易的替换视图的描述语言吗？（比如在同一个视图中用SOAP文档替换HTML文档）”</p>
<p><strong>模型（Model）</strong></p>
<p>模型代表了程序逻辑。（在企业级程序中经常称为业务层（business layer））</p>
<p>总的来说，模型的任务是把原有数据转换成包含某些意义的数据，这些数据将被视图所显示。通常，模型将封装数据查询，可能通过一些抽象数据类（数据访问层）来实现查询。举例说，你希望计算英国年度降雨量（只是为了给你自己找个好点的度假地），模型将接收十年中每天的降雨量，计算出平均值，再传递给视图。</p>
<p><strong>控制器（controller）</strong></p>
<p>简单的说控制器是Web应用中进入的HTTP请求最先调用的一部分。它检查收到的请求，比如一些GET变量，做出合适的反馈。在写出你的第一个控制器之前，你很难开始编写其他的PHP代码。最常见的用法是index.php中像switch语句的结构：</p>
<pre class="php">&lt;?php
switch ($_GET['viewpage']) {
    case "news":
        $page=new NewsRenderer;
    break;
    case "links":
        $page=new LinksRenderer;
    break;
    default:
        $page=new HomePageRenderer;
    break;
}
$page-&gt;display();
?&gt;</pre>
<p>这段代码混用了面向过程和对象的代码，但是对于小的站点来说，这通常是最好的选择。虽然上边的代码还可以优化。</p>
<p>控制器实际上是用来触发模型的数据和视图元素之间的绑定的控件。</p>
<p><strong>例子</strong></p>
<p>这里是一个使用MVC模式的简单例子。<br />
首先我们需要一个数据库访问类，它是一个普通类。</p>
<pre class="php">&lt;?php
/**
*  A simple class for querying MySQL
*/
class DataAccess {
    /**
    * Private
    * $db stores a database resource
    */
    var $db;
    /**
    * Private
    * $query stores a query resource
    */
    var $query; // Query resource 

    //! A constructor.
    /**
    * Constucts a new DataAccess object
    * @param $host string hostname for dbserver
    * @param $user string dbserver user
    * @param $pass string dbserver user password
    * @param $db string database name
    */
    function DataAccess ($host,$user,$pass,$db) {
        $this-&gt;db=mysql_pconnect($host,$user,$pass);
        mysql_select_db($db,$this-&gt;db);
    } 

    //! An accessor
    /**
    * Fetches a query resources and stores it in a local member
    * @param $sql string the database query to run
    * @return void
    */
    function fetch($sql) {
        $this-&gt;query=mysql_unbuffered_query($sql,$this-&gt;db); // Perform query here
    } 

    //! An accessor
    /**
    * Returns an associative array of a query row
    * @return mixed
    */
    function getRow () {
        if ( $row=mysql_fetch_array($this-&gt;query,MYSQL_ASSOC) )
            return $row;
        else
            return false;
    }
}
?&gt;</pre>
<p>在它上边放上模型。</p>
<pre class="php">&lt;?php
/**
*  Fetches "products" from the database
*/
class ProductModel {
    /**
    * Private
    * $dao an instance of the DataAccess class
    */
    var $dao; 

    //! A constructor.
    /**
    * Constucts a new ProductModel object
    * @param $dbobject an instance of the DataAccess class
    */
    function ProductModel (&amp;$dao) {
        $this-&gt;dao=&amp; $dao;
    } 

    //! A manipulator
    /**
    * Tells the $dboject to store this query as a resource
    * @param $start the row to start from
    * @param $rows the number of rows to fetch
    * @return void
    */
    function listProducts($start=1,$rows=50) {
        $this-&gt;dao-&gt;fetch("SELECT * FROM products LIMIT ".$start.", ".$rows);
    } 

    //! A manipulator
    /**
    * Tells the $dboject to store this query as a resource
    * @param $id a primary key for a row
    * @return void
    */
    function listProduct($id) {
        $this-&gt;dao-&gt;fetch("SELECT * FROM products WHERE PRODUCTID='".$id."'");
    } 

    //! A manipulator
    /**
    * Fetches a product as an associative array from the $dbobject
    * @return mixed
    */
    function getProduct() {
        if ( $product=$this-&gt;dao-&gt;getRow() )
            return $product;
        else
            return false;
    }
}
?&gt;</pre>
<p>有一点要注意的是，在模型和数据访问类之间，它们的交互从不会多于一行??没有多行被传送，那样会很快使程式慢下来。同样的程式对于使用模式的类，它只需要在内存中保留一行（Row）??其他的交给已保存的查询资源（query resource）??换句话说，我们让MYSQL替我们保持结果。</p>
<p>接下来是视图??我去掉了HTML以节省空间，你可以查看这篇文章的完整代码。</p>
<pre class="php">&lt;?php
/**
*  Binds product data to HTML rendering
*/
class ProductView {
    /**
    * Private
    * $model an instance of the ProductModel class
    */
    var $model; 

    /**
    * Private
    * $output rendered HTML is stored here for display
    */
    var $output; 

    //! A constructor.
    /**
    * Constucts a new ProductView object
    * @param $model an instance of the ProductModel class
    */
    function ProductView (&amp;$model) {
        $this-&gt;model=&amp; $model;
    } 

    //! A manipulator
    /**
    * Builds the top of an HTML page
    * @return void
    */
    function header () { 

    } 

    //! A manipulator
    /**
    * Builds the bottom of an HTML page
    * @return void
    */
    function footer () { 

    } 

    //! A manipulator
    /**
    * Displays a single product
    * @return void
    */
    function productItem($id=1) {
        $this-&gt;model-&gt;listProduct($id);
        while ( $product=$this-&gt;model-&gt;getProduct() ) {
             // Bind data to HTML
        }
    } 

    //! A manipulator
    /**
    * Builds a product table
    * @return void
    */
    function productTable($rownum=1) {
        $rowsperpage='20';
        $this-&gt;model-&gt;listProducts($rownum,$rowsperpage);
        while ( $product=$this-&gt;model-&gt;getProduct() ) {
             // Bind data to HTML
        }
    } 

    //! An accessor
    /**
    * Returns the rendered HTML
    * @return string
    */
    function display () {
        return $this-&gt;output;
    }
}
?&gt;</pre>
<p>最后是控制器，我们将把视图实现为一个子类。</p>
<pre class="php">&lt;?php
/**
*  Controls the application
*/
class ProductController extends ProductView { 

    //! A constructor.
    /**
    * Constucts a new ProductController object
    * @param $model an instance of the ProductModel class
    * @param $getvars the incoming HTTP GET method variables
    */
    function ProductController (&amp;$model,$getvars=null) {
        ProductView::ProductView($model);
        $this-&gt;header();
        switch ( $getvars['view'] ) {
            case "product":
                $this-&gt;productItem($getvars['id']);
                break;
            default:
                if ( empty ($getvars['rownum']) ) {
                    $this-&gt;productTable();
                } else {
                    $this-&gt;productTable($getvars['rownum']);
                }
                break;
        }
        $this-&gt;footer();
    }
}
?&gt;</pre>
<p><a href="/wp-content/uploads/2008/10/article_400x500_0561.gif" rel="lightbox[455]"><img class="alignnone size-medium wp-image-463" title="article_400x500_0561" src="/wp-content/uploads/2008/10/article_400x500_0561-300x178.gif" alt="" width="400" height="238" /></a></p>
<p>注意这不是实现MVC的唯一方式??比如你可以用控制器实现模型同时整合视图。这只是演示模式的一种方法。</p>
<p>我们的index.php 文件看起来像这样：</p>
<pre class="php">&lt;?php
require_once('lib/DataAccess.php');
require_once('lib/ProductModel.php');
require_once('lib/ProductView.php');
require_once('lib/ProductController.php'); 

$dao=&amp; new DataAccess ('localhost','user','pass','dbname');
$productModel=&amp; new ProductModel($dao);
$productController=&amp; new ProductController($productModel,$_GET);
echo $productController-&gt;display();
?&gt;</pre>
<p>漂亮而简单。</p>
<p>我们有一些使用控制器的技巧，在PHP中你可以这样做：</p>
<pre class="php">$this-&gt;{$_GET['method']}($_GET['param']);</pre>
<p>一个建议是你最好定义程序URL的名字空间形式（namespace），那样它会比较规范比如：</p>
<pre class="php">"index.php?class=ProductView&amp;method=productItem&amp;id=4"</pre>
<p>通过它我们可以这样处理我们的控制器：</p>
<pre class="php">$view=new $_GET['class'];
$view-&gt;{$_GET['method']($_GET['id']);</pre>
<p>有时候，建立控制器是件很困难的事情，比如当你在开发速度和适应性之间权衡时。一个获得灵感的好去处是Apache group 的Java Struts，它的控制器完全是由XML文档定义的。</p>
<p><a href="http://www.phpe.net/uploads/attach/article_phpMVC_0647.zip" target="_blank"><strong>相关附件：</strong>本文完整实例</a></p>
<p><strong>本文英文原版地址：</strong><a href="http://www.phppatterns.com/index.php/article/articleview/11/">http://www.phppatterns.com/index.php/article/articleview/11/</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="ZF框架中的MVC" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F1083&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F455">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/03/22/4027667.bmp" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">ZF框架中的MVC</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="编译php出错：error while loading shared libraries: libmysqlclient.so.18: cannot open shared object f" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F12479&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F455">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">编译php出错：error while loading shared libraries: libmysqlclient.so.18: cannot open shared object f</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="在安装php的make时候,出现错误&quot;chmod: cannot access `ext/phar/phar.phar': No such file or directory&quot;的解决办法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F12482&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F455">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">在安装php的make时候,出现错误&quot;chmod: cannot access `ext/phar/phar.phar': No such file or directory&quot;的解决办法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="PHP 输入／输出流" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F5123&from=http%3A%2F%2Fblog.haohtml.com%2Farchives%2F455">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PHP 输入／输出流</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.haohtml.com/archives/455/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

