English 中文(简体)
Zend View 助老会问题
原标题:Zend View Helper strange issue

我一直在就当地东道方(SOS:Snow Leopard)开展一个冷静的框架项目,当我把文件上载到主机(共用主机)时,我就使用该台的电击机提出一些错误。

More specifically:
The project structure is like this: ( i ommited some irrelevant subfolders and the numbers in the paranthesis is just for reference in here, it is not included in the folder name in the project)

application
-configs
-controllers
-layouts
--scripts
-models
-modules
--admin
---controllers
---models
---views(2)
----filters
----helpers(2)
----scripts
-views(1)
--helpers(1)
--scripts
library
public

在助手中(1) 具有观望助手,BasURL.php:

class Zend_View_Helper_BaseURL
{
    function baseURL()
    {
        $fc = Zend_Controller_Front::getInstance();
        return $fc->getBaseUrl();
    }
}

例如,在布局中,我用它来书写像CSS档案、JS文件这样的 st路。

<script src="<?php echo $this->baseURL();?>/public/js/somejavascript.js></script>

And usually i use it when i need the base url (not only in layouts,also in views). I have been using the same helper in the default module of the application and in the admin module (modules/admin/...). Localy, everything went ok, no issues. When i uploaded the project, i got errors like:

An error occurred
Application error
Exception information:

Message: Plugin by name  BaseURL  was not found in the registry; used paths: Cmsadmin_View_Helper_: /path_to_site_like_public_html/application/modules/cmsadmin/views/helpers/ Zend_View_Helper_: Zend/View/Helper/

以上错误是行政布局(行政模块中称)使用提款权加权法的线路。

At first i thought maybe because the helper is declared in another module (the default module), its not found by the framework in the admin module. But why locally everything works ? I dont get it. Also, if i change $this->baseURL() to $this->baseUrl() in the same admin.phtml layout file, in the admin module, everything works (online and locally).

如果有人能向我介绍一下哪怕是失踪了,那么我会不胜感激。

P.S.:由于我的头目尚不明确,也许有人可以告诉我: a 可在网站的所有模块中公布单元中的助手? (地方发展告诉我,自当地工作以来,当地情况是,上载项目有什么错误?)

感谢。

问题回答

检查

(a) 支付费用;

keeping the parameter null may fix the problem. you will get the baseurl in layout and also in default.php.

页: 1 Cmsadmin_View_Helper_,而不是Zend_View_Helper_,如错误信息所示。 错误信息表明它为各种预设办法所走的道路。

改为:

<script src="<?php echo $this->baseURL();?>/public/js/somejavascript.js></script>

<script src="<?php echo $this->baseUrl();?>/public/js/somejavascript.js></script>

not:- Always use $this->baseUrl(); its case sensitive





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

热门标签