English 中文(简体)
我如何通过控制者在泽斯德框架中看到一个变数?
原标题:How do I pass a variable from a controller to view in Zend Framework?

我正试图利用泽斯德框架,我对如何从控制者那里传递信息感到不安。

它像我这样想起Zentd_View的事例,但在我称职时,我似乎无法把正确的观点文件装上(例如,在指数行动中,我无法把它装上指数.phtml的档案,而不管我是如何尝试的)。

一个人能够告诉我,从控制者到泽斯德框架中的一种观点,是传递一个变量的最佳途径。

最佳回答

阁下:

<代码>$this->view->myvar = 价值

您随后的意见文件:

<? php呼应了thi和gt;myvar ?>

然而,这好像,你会遇到麻烦,使正确的看法负荷? 通常,这是由主计长行动根据命名公约进行的自动配置。 如果你需要使用替代模板,你可以做到:

$this->render ( viewname.phtml )

也许,你可以把你所发现的错误告诉我们,把你在你的控制员中做些什么写成法典,并且认为你正在做些什么。

问题回答

暂无回答




相关问题
Zend 邮件问题,涉及外国char子+ com子

泽斯德邮局在名称被定为具有外国性质(如“保”)和 com(”)的物品时,就放弃了一种例外(因为邮局(邮局)退回假)。 重新提出以下守则。

PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

Link to a specific step in onepage checkout

Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it? I m working on a payment module and have a sort of "cancel" action that i would ...

Tagging with Zend Framework

I m trying to create the same solutions as below, but using a simple MySQL query (instead of the static version used below where the words/tags are implemented in the code). The name of the MySQL ...

dynamicaly adding textboxes to zend_form

I hope that this is a quick question to answer. I am developing a form using Zend_Form, I have a number of Zend_Dojo_Form_Element_Textboxs to add to this form dynamically. These are added from rows ...

热门标签