【问题标题】:Zend render templates out of scripts folderZend 从脚本文件夹中渲染模板
【发布时间】:2012-01-31 13:19:32
【问题描述】:

我有一个问题...在我的 Zend 项目中,我在视图文件夹中创建了子文件夹...所以除了脚本之外,我还有表单和模板。但是当我尝试从某个控制器在表单文件夹中呈现模板时,它会自动在脚本文件夹中查找并将脚本文件夹设置为基本路径......我找到了这个功能: $this->view->setBasePath("../application/views/forms"); 但问题是它自动假定表单文件夹中有一个脚本子文件夹。但我不想创建一个,因为从我的角度来看是不需要的。

【问题讨论】:

    标签: zend-framework


    【解决方案1】:

    那是因为setBasePath() 这样做:Given a base path, sets the script, helper, and filter paths relative to it. Assumes a directory structure of: basePath/ scripts/ helpers/ filters/

    改用setScriptPath()

    【讨论】:

      猜你喜欢
      • 2018-08-17
      • 1970-01-01
      • 2023-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多