/docs/api/_partial_8php_source.html
HTML | 110 lines | 109 code | 0 blank | 1 comment | 0 complexity | d709632088fff2a3467e3a51d5cd70e9 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-3.0
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <title>openbiz: E:/E/GEAMP/www/openbiz/openbiz/others/Zend/View/Helper/Partial.php Source File</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <link href="doxygen.css" rel="stylesheet" type="text/css"/>
- </head>
- <body>
- <!-- Generated by Doxygen 1.7.2 -->
- <div class="navigation" id="top">
- <div class="tabs">
- <ul class="tablist">
- <li><a href="main.html"><span>Main Page</span></a></li>
- <li><a href="pages.html"><span>Related Pages</span></a></li>
- <li><a href="namespaces.html"><span>Namespaces</span></a></li>
- <li><a href="annotated.html"><span>Data Structures</span></a></li>
- <li class="current"><a href="files.html"><span>Files</span></a></li>
- <li><a href="examples.html"><span>Examples</span></a></li>
- </ul>
- </div>
- <div class="tabs2">
- <ul class="tablist">
- <li><a href="files.html"><span>File List</span></a></li>
- </ul>
- </div>
- <div class="header">
- <div class="headertitle">
- <h1>E:/E/GEAMP/www/openbiz/openbiz/others/Zend/View/Helper/Partial.php</h1> </div>
- </div>
- <div class="contents">
- <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <?php
- <a name="l00024"></a>00024 require_once <span class="stringliteral">'Zend/View/Helper/Abstract.php'</span>;
- <a name="l00025"></a>00025
- <a name="l00034"></a><a class="code" href="class_zend___view___helper___partial.html">00034</a> <span class="keyword">class </span><a class="code" href="class_zend___view___helper___partial.html">Zend_View_Helper_Partial</a> <span class="keyword">extends</span> <a class="code" href="class_zend___view___helper___abstract.html">Zend_View_Helper_Abstract</a>
- <a name="l00035"></a>00035 {
- <a name="l00040"></a>00040 <span class="keyword">protected</span> $_objectKey;
- <a name="l00041"></a>00041
- <a name="l00064"></a><a class="code" href="class_zend___view___helper___partial.html#a318993044ab1c39ef9fe02a02c377acd">00064</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___partial.html#a318993044ab1c39ef9fe02a02c377acd">partial</a>($name = null, $module = null, $model = null)
- <a name="l00065"></a>00065 {
- <a name="l00066"></a>00066 <span class="keywordflow">if</span> (0 == func_num_args()) {
- <a name="l00067"></a>00067 <span class="keywordflow">return</span> $this;
- <a name="l00068"></a>00068 }
- <a name="l00069"></a>00069
- <a name="l00070"></a>00070 $view = $this-><a class="code" href="class_zend___view___helper___partial.html#a7a5135f51fe89ad7254dd40c614f9439">cloneView</a>();
- <a name="l00071"></a>00071 <span class="keywordflow">if</span> (isset($this->partialCounter)) {
- <a name="l00072"></a>00072 $view->partialCounter = $this->partialCounter;
- <a name="l00073"></a>00073 }
- <a name="l00074"></a>00074 <span class="keywordflow">if</span> ((null !== $module) && is_string($module)) {
- <a name="l00075"></a>00075 require_once <span class="stringliteral">'Zend/Controller/Front.php'</span>;
- <a name="l00076"></a>00076 $moduleDir = Zend_Controller_Front::getInstance()->getControllerDirectory($module);
- <a name="l00077"></a>00077 <span class="keywordflow">if</span> (null === $moduleDir) {
- <a name="l00078"></a>00078 require_once <span class="stringliteral">'Zend/View/Helper/Partial/Exception.php'</span>;
- <a name="l00079"></a>00079 <span class="keywordflow">throw</span> <span class="keyword">new</span> <a class="code" href="class_zend___view___helper___partial___exception.html">Zend_View_Helper_Partial_Exception</a>(<span class="stringliteral">'Cannot render partial; module does not exist'</span>);
- <a name="l00080"></a>00080 }
- <a name="l00081"></a>00081 $viewsDir = dirname($moduleDir) . <span class="stringliteral">'/views'</span>;
- <a name="l00082"></a>00082 $view->addBasePath($viewsDir);
- <a name="l00083"></a>00083 } elseif ((null == $model) && (null !== $module)
- <a name="l00084"></a>00084 && (is_array($module) || is_object($module)))
- <a name="l00085"></a>00085 {
- <a name="l00086"></a>00086 $model = $module;
- <a name="l00087"></a>00087 }
- <a name="l00088"></a>00088
- <a name="l00089"></a>00089 <span class="keywordflow">if</span> (!empty($model)) {
- <a name="l00090"></a>00090 <span class="keywordflow">if</span> (is_array($model)) {
- <a name="l00091"></a>00091 $view->assign($model);
- <a name="l00092"></a>00092 } elseif (is_object($model)) {
- <a name="l00093"></a>00093 <span class="keywordflow">if</span> (null !== ($objectKey = $this-><a class="code" href="class_zend___view___helper___partial.html#aa8b2d73e47607bafcdfcc3bcb8c58c27">getObjectKey</a>())) {
- <a name="l00094"></a>00094 $view->assign($objectKey, $model);
- <a name="l00095"></a>00095 } elseif (method_exists($model, <span class="stringliteral">'toArray'</span>)) {
- <a name="l00096"></a>00096 $view->assign($model->toArray());
- <a name="l00097"></a>00097 } <span class="keywordflow">else</span> {
- <a name="l00098"></a>00098 $view->assign(get_object_vars($model));
- <a name="l00099"></a>00099 }
- <a name="l00100"></a>00100 }
- <a name="l00101"></a>00101 }
- <a name="l00102"></a>00102
- <a name="l00103"></a>00103 <span class="keywordflow">return</span> $view->render($name);
- <a name="l00104"></a>00104 }
- <a name="l00105"></a>00105
- <a name="l00111"></a><a class="code" href="class_zend___view___helper___partial.html#a7a5135f51fe89ad7254dd40c614f9439">00111</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___partial.html#a7a5135f51fe89ad7254dd40c614f9439">cloneView</a>()
- <a name="l00112"></a>00112 {
- <a name="l00113"></a>00113 $view = clone $this->view;
- <a name="l00114"></a>00114 $view->clearVars();
- <a name="l00115"></a>00115 <span class="keywordflow">return</span> $view;
- <a name="l00116"></a>00116 }
- <a name="l00117"></a>00117
- <a name="l00124"></a><a class="code" href="class_zend___view___helper___partial.html#a58aa3724a953370d377fd437f17b486a">00124</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___partial.html#a58aa3724a953370d377fd437f17b486a">setObjectKey</a>($key)
- <a name="l00125"></a>00125 {
- <a name="l00126"></a>00126 <span class="keywordflow">if</span> (null === $key) {
- <a name="l00127"></a>00127 $this->_objectKey = null;
- <a name="l00128"></a>00128 } <span class="keywordflow">else</span> {
- <a name="l00129"></a>00129 $this->_objectKey = (string) $key;
- <a name="l00130"></a>00130 }
- <a name="l00131"></a>00131
- <a name="l00132"></a>00132 <span class="keywordflow">return</span> $this;
- <a name="l00133"></a>00133 }
- <a name="l00134"></a>00134
- <a name="l00143"></a><a class="code" href="class_zend___view___helper___partial.html#aa8b2d73e47607bafcdfcc3bcb8c58c27">00143</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___partial.html#aa8b2d73e47607bafcdfcc3bcb8c58c27">getObjectKey</a>()
- <a name="l00144"></a>00144 {
- <a name="l00145"></a>00145 <span class="keywordflow">return</span> $this->_objectKey;
- <a name="l00146"></a>00146 }
- <a name="l00147"></a>00147 }
- </pre></div></div>
- </div>
- <hr class="footer"/><address class="footer"><small>Generated on Thu Apr 19 2012 17:01:18 for openbiz by 
- <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
- </body>
- </html>