<?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的PK经历 &#187; zend framework</title>
	<atom:link href="http://www.pkphp.com/category/zend-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pkphp.com</link>
	<description>PK with php!</description>
	<lastBuildDate>Tue, 23 Feb 2010 15:01:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[转]详细介绍php Zend Framework中的render使用方法</title>
		<link>http://www.pkphp.com/2010/01/09/zend-framework-render-intro/</link>
		<comments>http://www.pkphp.com/2010/01/09/zend-framework-render-intro/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 11:45:23 +0000</pubDate>
		<dc:creator>askie</dc:creator>
				<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.pkphp.com/?p=1026</guid>
		<description><![CDATA[通常在我们利用ZF实现php的mvc时,最关键的地方当然是Controller类的各种action方法,在action方法中,我们确定及输出内容. 在类 abstract class Zend_Controller_Action 中的dispatch方法你可以发现这一行 $this-&#62;$action();
那么如何确定及输出内容呢,就是进行render了,不过这个render却是有好几个的,下面列出这几个情形
1&#60;?php
2class IndexController extends Zend_Controller_Action
3{
4 public function contactAction()
5 {
6 //$this-&#62;render(&#8220;index&#8221;);
7 //$this-&#62;render();
8 //$this-&#62;renderScript(&#8220;sidebar.phtml&#8221;);
9
10
11 //$this-&#62;_helper-&#62;viewRenderer(&#8220;sidebar&#8221;);
12
13 //$this-&#62;view-&#62;render(&#8220;sidebar.phtml&#8221;);
14 //$this-&#62;view(&#8220;sidebar&#8221;); 
15
16 }
17}
18?&#62;
总结下来,似乎就是这三中render了(欢迎补充)
1.自身render
先看第一种
//$this-&#62;render(&#8220;index&#8221;);
//$this-&#62;render();
//$this-&#62;renderScript(&#8220;sidebar.phtml&#8221;);
这是直接使用Zend_Controller_Action类的render方法
第一句是render了另一个action所对应的视图(看清了 是render那个action对应的视图 而不是执行那个action!)
第二句式render本action对应的视图,这个有什么意义呢(因为很多情形你看不到这个写法的),这个下面再说.
第三句是render特定的视图文件,这里你可能认为前两个方法实际是调用了这个renderScript,其实不是如此.
下面就阐述一下.顺便解释第二句的原因.
Zend_Controller_Action类的render方法中其实是有两个分支的 如下render函数代码
1 public function render($action = null, $name = null, $noController = false)
2 {
3 if (!$this-&#62;getInvokeArg(&#8216;noViewRenderer&#8216;) &#38;&#38; $this-&#62;_helper-&#62;hasHelper(&#8216;viewRenderer&#8216;)) {
4 return $this-&#62;_helper-&#62;viewRenderer-&#62;render($action, $name, $noController);
5 }
6
7 $view = $this-&#62;initView();
8 $script = $this-&#62;getViewScript($action, $noController);
9
10 $this-&#62;getResponse()-&#62;appendBody(
11 $view-&#62;render($script),
12 [...]]]></description>
		<wfw:commentRss>http://www.pkphp.com/2010/01/09/zend-framework-render-intro/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>今日到南京上网，发现偶尔打开的网页出现如下代码</title>
		<link>http://www.pkphp.com/2008/09/10/%e4%bb%8a%e6%97%a5%e5%88%b0%e5%8d%97%e4%ba%ac%e4%b8%8a%e7%bd%91%ef%bc%8c%e5%8f%91%e7%8e%b0ff%e5%81%b6%e5%b0%94%e6%89%93%e5%bc%80%e7%9a%84%e7%bd%91%e9%a1%b5%e5%87%ba%e7%8e%b0%e5%a6%82%e4%b8%8b%e4%bb%a3/</link>
		<comments>http://www.pkphp.com/2008/09/10/%e4%bb%8a%e6%97%a5%e5%88%b0%e5%8d%97%e4%ba%ac%e4%b8%8a%e7%bd%91%ef%bc%8c%e5%8f%91%e7%8e%b0ff%e5%81%b6%e5%b0%94%e6%89%93%e5%bc%80%e7%9a%84%e7%bd%91%e9%a1%b5%e5%87%ba%e7%8e%b0%e5%a6%82%e4%b8%8b%e4%bb%a3/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 05:46:08 +0000</pubDate>
		<dc:creator>askie</dc:creator>
				<category><![CDATA[zend framework]]></category>
		<category><![CDATA[百宝箱]]></category>
		<category><![CDATA[ad.userads.info]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[木马]]></category>

		<guid isPermaLink="false">http://www.pkphp.com/?p=632</guid>
		<description><![CDATA[当打开某个新的域名是，偶尔网页会出现如下代码，代码在网页中出现的位置不固定，有时候在网页头部，有时候...]]></description>
		<wfw:commentRss>http://www.pkphp.com/2008/09/10/%e4%bb%8a%e6%97%a5%e5%88%b0%e5%8d%97%e4%ba%ac%e4%b8%8a%e7%bd%91%ef%bc%8c%e5%8f%91%e7%8e%b0ff%e5%81%b6%e5%b0%94%e6%89%93%e5%bc%80%e7%9a%84%e7%bd%91%e9%a1%b5%e5%87%ba%e7%8e%b0%e5%a6%82%e4%b8%8b%e4%bb%a3/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>zend framework错误或者异常信息捕捉</title>
		<link>http://www.pkphp.com/2008/08/27/zend-framework-exception/</link>
		<comments>http://www.pkphp.com/2008/08/27/zend-framework-exception/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 14:48:32 +0000</pubDate>
		<dc:creator>askie</dc:creator>
				<category><![CDATA[zend framework]]></category>
		<category><![CDATA[zendframework]]></category>
		<category><![CDATA[异常]]></category>
		<category><![CDATA[框架]]></category>
		<category><![CDATA[错误]]></category>

		<guid isPermaLink="false">http://www.pkphp.com/?p=537</guid>
		<description><![CDATA[今天在做一个项目是使用到了ZendFramework的错误或者异常信息控制机制，可以使用以下方法一次类推的处理所有zend framework框架中的任何异常。

try {
   /** 这里调用了Zend_Feed类. **/
   $channel = Zend_Feed::import($r['parentURL']);
}
catch (Zend_Feed_Exception $e)
{
     /** 当捕捉到Zend_Feed_Exception错误后在这里处理异常信息. **/
    echo $e;
}
catch( Zend_Exception $f)
{
   /** 如果没有捕捉到 Zend_Feed_Exception 或者 child异常信息，在这里处理. **/
  echo $f;
}

Related items

[转]详细介绍php Zend Framework中的render使用方法
svn错误：Authentication realm 解决办法
今日到南京上网，发现偶尔打开的网页出现如下代码
jQuery AJAX in Zend Framework
Zend Framework V1.5 中的新特性

zend 异常(2)Zend Framework 处理所有异常(1)Zendframework [...]]]></description>
		<wfw:commentRss>http://www.pkphp.com/2008/08/27/zend-framework-exception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery AJAX in Zend Framework</title>
		<link>http://www.pkphp.com/2008/07/04/jquery-ajax-in-zend-framework/</link>
		<comments>http://www.pkphp.com/2008/07/04/jquery-ajax-in-zend-framework/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 12:58:44 +0000</pubDate>
		<dc:creator>askie</dc:creator>
				<category><![CDATA[zend framework]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://www.pkphp.com/?p=144</guid>
		<description><![CDATA[研究一篇老外的文章：在zend framework中使用jquery


I have posted a sample code on my wiki on how to submit variables to an action controller. The sample code contains a niffty jQuery plugin - the jQuery Calendar.

Click here for the tutorial.

Update (05-07-2008): Since this post has been get...]]></description>
		<wfw:commentRss>http://www.pkphp.com/2008/07/04/jquery-ajax-in-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework V1.5 中的新特性</title>
		<link>http://www.pkphp.com/2008/06/24/zend-framework-v15-%e4%b8%ad%e7%9a%84%e6%96%b0%e7%89%b9%e6%80%a7/</link>
		<comments>http://www.pkphp.com/2008/06/24/zend-framework-v15-%e4%b8%ad%e7%9a%84%e6%96%b0%e7%89%b9%e6%80%a7/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 15:15:25 +0000</pubDate>
		<dc:creator>askie</dc:creator>
				<category><![CDATA[zend framework]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[特性]]></category>
		<category><![CDATA[组件]]></category>
		<category><![CDATA[验证器]]></category>

		<guid isPermaLink="false">http://www.pkphp.com/?p=90</guid>
		<description><![CDATA[流行的开源软件 Zend Framework 刚刚实现了一些出色的增强。本文介绍 V1.5 中的新特性以及如何升级对 GData Web 服务的增强支持，包括 Zend_Form、Zend_Layout 和 Zend_View，并且，改进的 Ajax 支持可以帮助 PHP 开发人员轻松地构建先进的 Web 应用程序。 ]]></description>
		<wfw:commentRss>http://www.pkphp.com/2008/06/24/zend-framework-v15-%e4%b8%ad%e7%9a%84%e6%96%b0%e7%89%b9%e6%80%a7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>【转帖】Zend Framework中Ajax的一个使用技巧</title>
		<link>http://www.pkphp.com/2008/04/01/%e3%80%90%e8%bd%ac%e5%b8%96%e3%80%91zend-framework%e4%b8%adajax%e7%9a%84%e4%b8%80%e4%b8%aa%e4%bd%bf%e7%94%a8%e6%8a%80%e5%b7%a7/</link>
		<comments>http://www.pkphp.com/2008/04/01/%e3%80%90%e8%bd%ac%e5%b8%96%e3%80%91zend-framework%e4%b8%adajax%e7%9a%84%e4%b8%80%e4%b8%aa%e4%bd%bf%e7%94%a8%e6%8a%80%e5%b7%a7/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 12:43:57 +0000</pubDate>
		<dc:creator>askie</dc:creator>
				<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.pkphp.com/?p=20</guid>
		<description><![CDATA[前言：其实这个技巧，不限于Zend Framework。我对于这个技巧，是来自Ruby On Rails的学习过程中，在Thomas的书中有提到这种ajax场景；而本文章主要讲述这个技巧在Zend Framework中如何实现。
几点说明：
1、本文章的Js部分，采用jQuery；我比较中意这个。但是本文章侧重讲的是一个思路；而不是js的写法技巧。
2、阅读本文章前，最好对Zend Framework了解；并了解Zend_Layout的概念。
一个场景的处理思考
先从一个场景来入手。假设你有一个请求时http://project-name/product/list，来显示商品列表。而，普通情况下，你的这个
请求来自左侧菜单栏；请求方式是一个ajax请求；即不更新菜单栏以及header
footer，只更新在&#60;divid=&#8217;mainbody&#8217;&#62;&#60;/div&#62;的内容。
这是一个常见的ajax应用场景。
一般情况下，是没什么问题。但是有一天一个聪明的用户知道这个url(知道方法很多)，而直接在浏览器上输入http://project-name/product/list，那么结果呢？
你显示了一块不带有header footer 的html代码，你的界面里没有定义css，因此显示很难看；没有js，可能很多点击无效无法工作。
用户不懂这些，他只知道出现error。
这个情况，你遇到过吗？我的应用中，其实就遇到过；之前的解决办法没有，只是希望用户别这么聪明。
好了，问题明白了；解决之前，我们先一起看看Zend_Layout的使用方法。
更多的Zend_Layout的学习，可以先阅读 http://akrabat.com/2007/12/11/simple-zend_layout-example/的内容 以及官方文档 http://framework.zend.com/manual/en/zend.layout.html
首先建立一个普通的Zend_Layout使用例。

复制PHP内容到剪贴板
PHP代码:
private function _buildMVCLayout(){
//增加layout
//$this-&#62;_config 是一个Zend_Config_Xml类；内容来自一个配置文件。
if(!empty($this-&#62;_config-&#62;view-&#62;layout-&#62;enable)){
$_viewPath = trim($this-&#62;_config-&#62;view-&#62;layout-&#62;path);
$_viewPath = empty($_viewPath)?'layout':$_viewPath;
Zend_Layout::startMvc(array('layoutPath'=&#62;APP_DIR.DIRECTORY_SEPARATOR.$_viewPath));
}
}

那么，在layout的目录下，建立一个lauout.phtml
复制PHP内容到剪贴板
PHP代码:
&#60;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&#62;
&#60;html xmlns="http://www.w3.org/1999/xhtml" lang="en"&#62;
&#60;head&#62;
&#60;meta http-equiv="content-type" c /&#62;
&#60;meta name="description" c /&#62;
&#60;meta name="keywords" c /&#62;
&#60;link rel="icon" type="image/x-icon" href="&#60;?php echo $this-&#62;baseUrl; ?&#62;/public/images/layout/favicon.ico" /&#62;
&#60;title&#62;&#60;?php echo empty ( $this-&#62;title ) ? $this-&#62;translate ( 'meta.title.default' ) : $this-&#62;escape [...]]]></description>
		<wfw:commentRss>http://www.pkphp.com/2008/04/01/%e3%80%90%e8%bd%ac%e5%b8%96%e3%80%91zend-framework%e4%b8%adajax%e7%9a%84%e4%b8%80%e4%b8%aa%e4%bd%bf%e7%94%a8%e6%8a%80%e5%b7%a7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework MVC流程图[转帖]</title>
		<link>http://www.pkphp.com/2008/03/24/zend-framework-mvc%e6%b5%81%e7%a8%8b%e5%9b%be%e8%bd%ac%e5%b8%96/</link>
		<comments>http://www.pkphp.com/2008/03/24/zend-framework-mvc%e6%b5%81%e7%a8%8b%e5%9b%be%e8%bd%ac%e5%b8%96/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 04:52:58 +0000</pubDate>
		<dc:creator>askie</dc:creator>
				<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.pkphp.com/?p=11</guid>
		<description><![CDATA[
这个图是ZF文档中的，7.2节的图。由于中文文档还没有翻译，所以先搞个图看看，这个图画的非常好，非常明朗。
我已经用不同的颜色标注了不同的部分。主要流程是绿色块，黄色部分是钩子，这种蓝色代表Request和Response对象，紫红色部分判断是否
dispath完毕。基本方向就是：Request -&#62; Router -&#62; Dispatch -&#62; Send Response
Related items

[转]详细介绍php Zend Framework中的render使用方法
今日到南京上网，发现偶尔打开的网页出现如下代码
zend framework错误或者异常信息捕捉
jQuery AJAX in Zend Framework
Zend Framework V1.5 中的新特性

http://www.pkphp.com/(1)zend 流程(3)zend framework MVC(22)zend framework mvc 代码(1)优化 zend framework mvc(1)php mvc framework(4)mvc 图(6)php zend mvc(3)zend 流程图(3)zend framework流程图(1)mvc 流程图(2)Zend Framework 流程图(8)php 流程图(11)zend framework流程(8)framework mvc(1)]]></description>
		<wfw:commentRss>http://www.pkphp.com/2008/03/24/zend-framework-mvc%e6%b5%81%e7%a8%8b%e5%9b%be%e8%bd%ac%e5%b8%96/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于zf占位符的研究</title>
		<link>http://www.pkphp.com/2008/03/20/%e5%85%b3%e4%ba%8ezf%e5%8d%a0%e4%bd%8d%e7%ac%a6%e7%9a%84%e7%a0%94%e7%a9%b6/</link>
		<comments>http://www.pkphp.com/2008/03/20/%e5%85%b3%e4%ba%8ezf%e5%8d%a0%e4%bd%8d%e7%ac%a6%e7%9a%84%e7%a0%94%e7%a9%b6/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 15:19:50 +0000</pubDate>
		<dc:creator>askie</dc:creator>
				<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.pkphp.com/?p=9</guid>
		<description><![CDATA[区域助手（Partial Helper）
Partial 视图助手被用来在它自己的变量范围内解析特定的模板。主要用法是（解析）可重用的模板片段，你不需要操心变量名的冲突。另外，它们允许你从特定的模块指定 partial 视图脚本。
Partial 的兄弟 PartialLoop 视图助手允许传递可迭代数据并为每个条目解析一部分。
例 37.2.  Partials 的基本用法 
partials 的基本用法是在它自己的视图范围内解析一个模板的片段。

&#60;?php // partial.phtml ?&#62;
&#60;ul&#62;
&#60;li&#62;From: &#60;?= $this-&#62;escape($this-&#62;from) &#62;?&#60;/li&#62;
&#60;li&#62;Subject: &#60;?= $this-&#62;escape($this-&#62;subject) &#62;?&#60;/li&#62;
&#60;/ul&#62;


你可以这样从视图脚本里调用它：

&#60;?= $this-&#62;partial('partial.phtml', array(
'from' =&#62; 'Team Framework',
'subject' =&#62; 'view partials')); ?&#62;


解析结果如下：

&#60;ul&#62;
&#60;li&#62;From: Team Framework&#60;/li&#62;
&#60;li&#62;Subject: view partials&#60;/li&#62;
&#60;/ul&#62;

其他的可以参考：占位符 

Related items

[转]详细介绍php Zend Framework中的render使用方法
今日到南京上网，发现偶尔打开的网页出现如下代码
zend framework错误或者异常信息捕捉
jQuery AJAX in Zend Framework
Zend Framework V1.5 中的新特性

php占位符(1)]]></description>
		<wfw:commentRss>http://www.pkphp.com/2008/03/20/%e5%85%b3%e4%ba%8ezf%e5%8d%a0%e4%bd%8d%e7%ac%a6%e7%9a%84%e7%a0%94%e7%a9%b6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
