久久久久久久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;為什么?)
主站蜘蛛池模板: 亚洲国产精品久久久久秋霞不卡 | 亚洲一级黄色 | 亚洲毛片在线观看 | 亚洲国产精品视频 | 亚洲黄色视屏 | 亚洲成人av一区二区 | 中文字幕国产一区 | 免费性视频 | 欧美亚洲另类丝袜综合网动图 | 色资源站 | 紧缚调教一区二区三区视频 | 日韩毛片播放 | 先锋资源网站 | 9191av| 亚洲在线免费 | 韩日在线 | 亚洲精品视频久久 | 皇色视频在线 | 国产精品久久久久久久久久久久 | 国产sm主人调教女m视频 | 精品国产欧美 | 国产一区二区在线视频 | 久久99精品久久 | 天天看天天操 | 99一级毛片| 亚洲第1页 | 欧美激情一区二区三区 | 亚洲福利精品 | 亚洲综合视频 | 中国一级特黄真人毛片免费观看 | 久久在线 | 福利视频一区二区 | 亚洲人在线观看视频 | av一区二区三区四区 | 欧美精品一区免费 | 国产精品永久久久久 | 小早川怜子xxxxaⅴ在线 | 亚洲欧洲色视频 | 欧美日韩在线免费观看 | 久久a久久 | 中文字幕一区二区三区精彩视频 |