<?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>精東·博客 &#187; ZendFramework</title>
	<atom:link href="http://www.wemvc.com/tag/zendframework/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wemvc.com</link>
	<description>男人的胸怀是委屈撑大的。</description>
	<lastBuildDate>Sun, 29 Aug 2010 04:21:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Zend Framework与Dojo联用开发RIA</title>
		<link>http://www.wemvc.com/413.html</link>
		<comments>http://www.wemvc.com/413.html#comments</comments>
		<pubDate>Mon, 29 Sep 2008 14:19:04 +0000</pubDate>
		<dc:creator>精东</dc:creator>
				<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Dojo]]></category>
		<category><![CDATA[Zend Framwork]]></category>
		<category><![CDATA[ZendFramework]]></category>

		<guid isPermaLink="false">http://www.wemvc.com/?p=413</guid>
		<description><![CDATA[一、Dojo 入门简介:
随着富互联网应用程序（Rich Internet Application，RIA）的发展，一批 JavaScript Toolkit 也随之兴起 , Dojo 便是其中的优秀代表，本系列文章将由浅入深带领读者走进 Dojo 的世界。本文作为这个系列的开篇 , 主要讲述了 Dojo 的体系架构以及如何安装使用。
伴随 Web 2.0, Ajax 和 RIA 的热潮，各种 Ajax 开发工具包如雨后春笋般蓬勃发展，Dojo 正是这些工具包中的佼佼者。Dojo 为富互联网应用程序(RIA) 的开发提供了完整的端到端的解决方案，包括核心的 JavaScript 库，简单易用的小部件（Widget）系统和一个测试框架，此外，Dojo 的开源开发社区还在不停地为它提供新的功能。
Dojo 是一个 JavaScript 实现的开源 DHTML 工具包。它是在几个项目捐助基础上建立起来的(nWidgets，f(m)，Burstlib) 。 Dojo 的最初目标是解决开发 DHTML 应用程序遇到的一些长期存在的历史问题，现在，Dojo 已经成为了开发 RIA 应用程序的利器：

Dojo 让您更容易地为 Web 页面添加动态能力，您也可以在其它支持 JavaScript 的环境中使用 Dojo ；
利用 Dojo 提供的组件，您可以提升 Web 应用程序的可用性和交互能力；
Dojo 很大程度上屏蔽了浏览器之间的差异性，因此，您可以不用担心 [...]]]></description>
		<wfw:commentRss>http://www.wemvc.com/413.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Zend Framework 体系结构图</title>
		<link>http://www.wemvc.com/406.html</link>
		<comments>http://www.wemvc.com/406.html#comments</comments>
		<pubDate>Sun, 28 Sep 2008 14:42:38 +0000</pubDate>
		<dc:creator>精东</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend Framwork]]></category>
		<category><![CDATA[ZendFramework]]></category>

		<guid isPermaLink="false">http://www.wemvc.com/?p=406</guid>
		<description><![CDATA[
]]></description>
		<wfw:commentRss>http://www.wemvc.com/406.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework Zend_Validate_Date 验证方法</title>
		<link>http://www.wemvc.com/321.html</link>
		<comments>http://www.wemvc.com/321.html#comments</comments>
		<pubDate>Thu, 25 Sep 2008 04:00:34 +0000</pubDate>
		<dc:creator>精东</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend Framwork]]></category>
		<category><![CDATA[ZendFramework]]></category>

		<guid isPermaLink="false">http://www.wemvc.com/?p=321</guid>
		<description><![CDATA[默认格式为 月/日/年 m/d/Y
$v = new Zend_Validate_Date();
自订日期格式
$v = new Zend_Validate_Date('d-F-Y');
自订日期格式＋起始日期
$v = new Zend_Validate_Date('d-F-Y', '06-September-2007');
自订日期格式＋截止日期
$v = new Zend_Validate_Date('d-F-Y', null, '06-September-2007');
Instantiating the validator with a custom date format and a start date of whatever day it is
$v = new Zend_Validate_Date('d-F-Y', Zend_Validate_Date::TODAY);
自订日期格式＋起始日期＋截止日期
$v = new Zend_Validate_Date('M-d-Y', 'Sep-01-2007', 'Sep-30-2007');
中国时间写法
$v = new Zend_Validate_Date('Y-m-d');
$v = new Zend_Validate_Date('Y-m-d', '2007-09-23');
$v = new Zend_Validate_Date('Y-m-d', '2007-09-23', '2008-09-23');
判断方法：
if($v-&#62;isValid($your_date))
]]></description>
		<wfw:commentRss>http://www.wemvc.com/321.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zend Framework 页面布局</title>
		<link>http://www.wemvc.com/291.html</link>
		<comments>http://www.wemvc.com/291.html#comments</comments>
		<pubDate>Thu, 28 Aug 2008 07:24:30 +0000</pubDate>
		<dc:creator>精东</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend Framwork]]></category>
		<category><![CDATA[ZendFramework]]></category>

		<guid isPermaLink="false">http://www.wemvc.com/291.html</guid>
		<description><![CDATA[Zend Framework 的页面布局模块——Zend_Layout——既可以跟 MVC 一起使用，也可以单独使用。本文只讨论与 MVC 一起使用的情况。
1. 布局脚本
在 application/views 下创建一个 layouts 的文件夹。主布局脚本 layout.phtml 代码如下：



&#60;?php echo $this-&#62;doctype(&#8216;XHTML1_STRICT&#8217;) ?&#62;
&#60;html&#62;
&#60;head&#62;
&#60;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text/html; charset=utf-8&#8243; /&#62;
&#60;?php echo $this-&#62;headTitle() ?&#62;
&#60;?php
$this-&#62;headLink()-&#62;appendStylesheet(&#8220;/styles/main.css&#8221;);
// add more links &#8230;
?&#62;
&#60;?php echo $this-&#62;headLink() ?&#62;
&#60;/head&#62;
&#60;body&#62;
&#60;div id=&#8221;header&#8221;&#62;
&#60;?php echo $this-&#62;partial(&#8216;header.phtml&#8217;) ?&#62;
&#60;/div&#62;
&#60;table&#62;
&#60;tr&#62;
&#60;td valign=top&#62;
&#60;div id=&#8221;leftcolumn&#8221;&#62;
&#60;?php echo $this-&#62;partial(&#8216;leftcolumn.phtml&#8217;) ?&#62;
&#60;/div&#62;
&#60;/td&#62;
&#60;td valign=top&#62;
&#60;div id=&#8221;content&#8221;&#62;
&#60;?php echo $this-&#62;layout()-&#62;content ?&#62;
&#60;/div&#62;
&#60;/td&#62;
&#60;/tr&#62;
&#60;/table&#62;
&#60;div id=&#8221;footer&#8221;&#62;
&#60;?php echo $this-&#62;partial(&#8216;footer.phtml&#8217;) ?&#62;
&#60;/div&#62;
&#60;/body&#62;
&#60;/html&#62;



除了 layout.phtml 之外，还需要编写 header.phtml，leftcolumn.phtml，footer.phtml，以及 main.css 等文件。
Zend Framework [...]]]></description>
		<wfw:commentRss>http://www.wemvc.com/291.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zend Framework 多国语言支持</title>
		<link>http://www.wemvc.com/289.html</link>
		<comments>http://www.wemvc.com/289.html#comments</comments>
		<pubDate>Thu, 28 Aug 2008 07:23:24 +0000</pubDate>
		<dc:creator>精东</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend Framwork]]></category>
		<category><![CDATA[ZendFramework]]></category>

		<guid isPermaLink="false">http://www.wemvc.com/?p=289</guid>
		<description><![CDATA[如果你的项目想要支持多语言版本，那么就需要用到 Zend_Translate。Zend_Translate 的详细文档在这里，不过如果想偷懒的话，也很简单，在 View Helpers 文档中介绍了如何用 Translate Helper 轻松实现多语言支持。
1. 准备翻译文件
Zend_Translate 支持多种格式的翻译文件。选用何种格式可以参考这里。如果条目不是很多（5000条以下），那么可以考虑用最直观的数组格式，而且可以写到一个 php 文件里。假设，我们需要一个中文版支持，翻译文件命名为 zh_cn.php，放在与 application 平行的 languages 文件夹里。该文件内容如下：




&#60;?php
return array(
&#8216;hello_world&#8217; =&#62; &#8216;你好！&#8217;,
);



2. 加载翻译文件
编辑 html/index.php 文件，在前端控制器运行之前，插入下面的代码：



require_once &#8216;Zend/Registry.php&#8217;;
require_once &#8216;Zend/Translate.php&#8217;;
$adapter = new Zend_Translate(&#8216;array&#8217;, $rootPath . &#8216;/languages/zh_cn.php&#8217;, &#8216;zh&#8217;);
Zend_Registry::set(&#8216;Zend_Translate&#8217;, $adapter);



上述代码的作用是载入 zh_cn.php，并把它保存成全局变量。Zend_Registry 可以看成是一个全局变量容器。
注意：在保存到 Zend_Registry 中时，键值必须是 Zend_Translate，否则，得不到应有的结果。
3. 在视图中使用翻译条目
编辑 application/views/scripts/index/index.phtml 文件，将原来的“&#60;h1&#62;Hello World!&#60;/h1&#62;”替换成：




&#60;h1&#62;&#60;?php echo $this-&#62;translate(&#8216;hello_world&#8217;); ?&#62;&#60;/h1&#62;



4. 查看页面
这时，浏览器中看到的应是“你好！”。
]]></description>
		<wfw:commentRss>http://www.wemvc.com/289.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework 错误处理</title>
		<link>http://www.wemvc.com/287.html</link>
		<comments>http://www.wemvc.com/287.html#comments</comments>
		<pubDate>Thu, 28 Aug 2008 07:22:23 +0000</pubDate>
		<dc:creator>精东</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend Framwork]]></category>
		<category><![CDATA[ZendFramework]]></category>

		<guid isPermaLink="false">http://www.wemvc.com/?p=287</guid>
		<description><![CDATA[使用 Zend Framework 的 MVC 结构，如果不做特殊的处理，所有的异常都会被前端控制器捕获，并累积起来。
Zend Framework 提供了若干种方法来处理异常。这里介绍最简单的一种。
在第一部分《快速上手》中，我们已经有了一个很简单的错误处理机制，即通过 applicatoin/controllers/ErrorController.php 以及其中定义的 errorAction 方法来处理异常。不过，只是给出了一个很简陋的报错信息。现在，我们把它再完善一下，达到两个基本要求：

用户请求了不存在的控制器或动作（404 错误），在用户的浏览器中给出报错信息；
其他的系统错误，则在日志文件中记录下来。

1. 创建日志
创建一个与 application 平行的文件夹，命名为 logs。
编辑 html/index.php 文件，加入下面的代码：



require_once &#8216;Zend/Log.php&#8217;;
require_once &#8216;Zend/Log/Writer/Stream.php&#8217;;
$log = new Zend_Log(new Zend_Log_Writer_Stream($rootPath . &#8216;/logs/errors.log&#8217;, &#8216;a+&#8217;));
Zend_Registry::set(&#8216;error_log&#8217;, $log);



注意：Web 服务器应具有对 logs 文件夹的读写权限。
2. 完善错误处理代码
编辑 application/controllers/ErrorController.php 文件，新的 errrorAction 方法为：



public function errorAction()
{
$log = Zend_Registry::get(&#8216;error_log&#8217;);
$content = null;
$errors = $this-&#62;_getParam (&#8216;error_handler&#8217;) ;
switch ($errors-&#62;type) {
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER :
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION :
// 404 error [...]]]></description>
		<wfw:commentRss>http://www.wemvc.com/287.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework 入门——快速上手</title>
		<link>http://www.wemvc.com/283.html</link>
		<comments>http://www.wemvc.com/283.html#comments</comments>
		<pubDate>Thu, 28 Aug 2008 07:16:49 +0000</pubDate>
		<dc:creator>精东</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend Framwork]]></category>
		<category><![CDATA[ZendFramework]]></category>

		<guid isPermaLink="false">http://www.wemvc.com/?p=283</guid>
		<description><![CDATA[1. 安装
从 Zend Framework 的网页上下载最新版本。解压后，把整个目录拷贝到一个理想的地方，比如：/php/library/Zend。
打开 php.ini 文件，确认包含 Zend 目录的路径在 include_path 里定义了。以上面的配置为例，php.ini 中应有类似下面的条目：
include_path = &#8220;.:/php/library&#8221;
注意：Windows 下的写法略有不同，应该类似于 include_path = &#8220;.;C:\php\library&#8221;
初始的安装就这么简单。Zend Framework 的一些组件会用到 php 的一些附加模块。具体的要求请参考这里。
2. 项目的目录结构
如果你的项目不包含多个模块，可以用下面的目录结构：
application/
    controllers/
        IndexController.php
    models/
    views/
        scripts/
     [...]]]></description>
		<wfw:commentRss>http://www.wemvc.com/283.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend_Acl / Zend_Auth 例子</title>
		<link>http://www.wemvc.com/271.html</link>
		<comments>http://www.wemvc.com/271.html#comments</comments>
		<pubDate>Wed, 27 Aug 2008 03:16:45 +0000</pubDate>
		<dc:creator>精东</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend Framwork]]></category>
		<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[Zend_Acl]]></category>
		<category><![CDATA[Zend_Auth]]></category>

		<guid isPermaLink="false">http://www.wemvc.com/?p=271</guid>
		<description><![CDATA[Zend_Acl / Zend_Auth example scenario
by Simon Mundy
Hi there all
After submitting the initial example of how Zend_Auth and Zend_Acl could be implemented Gavin pointed out areas that weren&#8217;t really addressed in my proof of concept and it could potentially confuse newcomers to the way MVC is utilised. I&#8217;d like to clarify that post to a) Address [...]]]></description>
		<wfw:commentRss>http://www.wemvc.com/271.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>为你的ZendFramework选择合适的目录结构</title>
		<link>http://www.wemvc.com/268.html</link>
		<comments>http://www.wemvc.com/268.html#comments</comments>
		<pubDate>Wed, 27 Aug 2008 03:14:52 +0000</pubDate>
		<dc:creator>精东</dc:creator>
				<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend Framwork]]></category>
		<category><![CDATA[ZendFramework]]></category>

		<guid isPermaLink="false">http://www.wemvc.com/?p=268</guid>
		<description><![CDATA[Choosing Your Application&#8217;s Directory Layout
This document demonstrates and named types of file organization schemes (layouts) that are commonly found in dynamic web applications. This document aids developers starting new projects by explaining the pros and cons associated with each of the popular layouts below. Community contributed suggestions and guidelines help provide insight into suggested approaches [...]]]></description>
		<wfw:commentRss>http://www.wemvc.com/268.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
