久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

我在哪里保存 Zend Framework 中的部分(視圖),以便

Where do I save partial (views) in Zend Framework, to be accessible for all Views in my App?(我在哪里保存 Zend Framework 中的部分(視圖),以便我的應(yīng)用程序中的所有視圖都可以訪問?) - IT屋-程序員軟件開發(fā)技術(shù)
本文介紹了我在哪里保存 Zend Framework 中的部分(視圖),以便我的應(yīng)用程序中的所有視圖都可以訪問?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我有幾個(gè)視圖部分(如分頁器部分),我希望它們可用我的應(yīng)用程序中的所有視圖腳本.
是否有一個(gè)目錄可以讓我放入部分競(jìng)爭(zhēng),并且所有人都可以使用它們?
或者,我如何定義這樣的目錄?

I have several view Partials (like paginator partial) which I want them to be available To all view scripts in my application.
Is there a directory I can put partial vies in, and they will be available to all?
Or, how do I define such a directory?

推薦答案

您可以在視圖文件夾中創(chuàng)建一個(gè)具有任何名稱的文件夾,您可以從您的視圖中使用以下代碼調(diào)用部分,并作為第二個(gè)參數(shù)傳遞一個(gè)數(shù)組將在部分中使用的值.

You can create a folder in the views folder with any name and from your views you would call a partial using the following code and as the second argument pass an array of values which would be used within the partial.

$this->partial('your-partial-dir/your-partial.phtml', array('var'=>$myVar));

請(qǐng)注意,您可以從以視圖文件夾為根目錄的任何視圖中包含和渲染任何部分視圖.并且您將使用 $this 標(biāo)識(shí)符訪問部分中的變量以引用每個(gè)變量,就好像它是部分對(duì)象的成員一樣:

Note that you can include and render any partial view from any view referring to the views folder as the root. And you would access variables within the partial using the $this identifier to refer to each variable as though it was a member of the partial object:

//your-partial.phtml file

$this->var;

或者,您也可以創(chuàng)建視圖助手 - 視圖助手是從 Zend_View_helper 類聲明和擴(kuò)展的類,可以從視圖中調(diào)用,就像它是成員函數(shù)一樣.

Alternatively you can also create a view helper - a view helper is a class that is declared and extended from the Zend_View_helper class and can be called from a view as though it was a member function.

有關(guān)視圖助手的更多信息,您可以參考 Zend 上的這篇文章 http://devzone.zend.com/article/3412-View-Helpers-in-Zend-Framework

For more on view helpers you can refer to this write up on Zend http://devzone.zend.com/article/3412-View-Helpers-in-Zend-Framework

這篇關(guān)于我在哪里保存 Zend Framework 中的部分(視圖),以便我的應(yīng)用程序中的所有視圖都可以訪問?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Action View Helper in Zend - Work around?(Zend 中的動(dòng)作視圖助手 - 解決方法?)
Is this a good way to match URI to class/method in PHP for MVC(這是將 URI 與 PHP 中用于 MVC 的類/方法匹配的好方法嗎)
Having a single entry point to a website. Bad? Good? Non-issue?(有一個(gè)網(wǎng)站的單一入口點(diǎn).壞的?好的?沒問題?)
Is MVC + Service Layer common in zend or PHP?(MVC + 服務(wù)層在 Zend 或 PHP 中常見嗎?)
Hello World example in MVC approach to PHP(PHP MVC 方法中的 Hello World 示例)
Separation of concerns; MVC; why?(關(guān)注點(diǎn)分離;MVC;為什么?)
主站蜘蛛池模板: 欧美天堂 | 国产亚洲一区二区三区在线观看 | 亚洲综合婷婷 | 91在线观看网址 | 亚洲精品久久久一区二区三区 | 成人欧美一区二区三区黑人孕妇 | 欧美三级网站 | 天堂一区二区三区四区 | 欧美成人精品 | 国产精品视频一区二区三区四蜜臂 | 久久久青草婷婷精品综合日韩 | 日韩精品成人一区二区三区视频 | h视频在线看| 亚洲最大福利网 | 精品久久久久久亚洲精品 | 国产亚洲人成a在线v网站 | 夜夜夜夜草 | 国产精品欧美一区二区三区 | 日韩成人精品在线 | 日韩a在线 | 国产精品日韩在线观看一区二区 | 国内精品视频一区二区三区 | 新超碰97 | 一区二区免费看 | 亚洲精品成人在线 | 亚洲精品国产成人 | 久久97精品 | 欧美中国少妇xxx性高请视频 | 国产色婷婷精品综合在线手机播放 | 久久精品视频网站 | 欧美日韩黄| 日韩欧美在线观看视频 | 中文字幕在线免费视频 | 毛色毛片免费看 | 天天操夜夜操 | av日韩在线播放 | 青青草精品视频 | 国产在视频一区二区三区吞精 | 成人免费在线观看视频 | 欧美色a v | 亚洲午夜精品一区二区三区他趣 |