English 中文(简体)
一位控制员
原标题:zend one controller many views

当我最初建造网站时,它只处理一个接口,但现在我需要处理许多接口。

我可以发现哪一个地点可以提出每一项要求,并将每个地点与其他地点分开,但所有地点都有同样的看法。

是否有办法使我能与同样的控制者提出不同的看法?

我想到的是:

application
            controller
            model
            site_1_view
            site_2_view

这是可能的吗?

最佳回答

很简单——我发现,我可以在我的构造中确定观点基础:

$this->view->setBasePath("../application/site_1_view/views");

因此,在public/index.php上,我发现URL,将其安排在会议上,从我的行文中查找名字,然后使用名称确定基路:

$this->view->setBasePath("../application/".$siteName."/views");

因此,申请结构目前是:

 application
            controllers
            model
            site_1_view
                         views
                                scripts
                                         controllerName
                                                        ActionName 

            site_2_view
                         views
                                scripts
                                         controllerName
                                                        ActionName  
问题回答
$this->view->render( script.phtml ); 

应当工作。

或:

public function myAction() 
{
    return $this->otherAction();
}

public function otherAction() 
{

}

add a new scripts path to view LIFO stack

只是一个想法:查明目前对哪一个地点的看法,然后将Zentd_View告知使用该具体网站的文字,为此将制定<代码>$view-> 定本(/path/to/site1/scripts/);。

Edit:我可能错了,但确定这一点的最佳地点是<代码>preDissu方法中的控制器粉末,当时,你将知道要求什么模块/控制器/行动,但还未发出:





相关问题
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 ...

热门标签