简体   繁体   English

如何在Zend Framework的config中包括自定义文件夹?

[英]How to include custom folder in config in Zend Framework?

How to add include path to custom folder in application.ini in Zend Framework? 如何在Zend Framework中的application.ini中向自定义文件夹添加包含路径? I need access to some classes from custom folder. 我需要从自定义文件夹访问某些类。

Thx for answers. 谢谢答案。 Kamilos 卡米洛斯

includePaths.customfolder = APPLICATION_PATH "/../customfolder"

structure your applications: 构建应用程序:

application
data
library
public

in application.ini 在application.ini中

data_uploads = APPLICATION_PATH "/../data/uploads"

in Bootstrap.php 在Bootstrap.php中

public function _initDefines()
{
    define('DATA_UPLOADS', $this->getOption('data_uploads'));
}

now you can use DATA_UPLOADS define in your script php! 现在,您可以在脚本php中使用DATA_UPLOADS定义! ;) ;)


UPDATE 更新

add this to application.ini 将此添加到application.ini

autoloadernamespaces[] = "Foo_"

in you libray add directory Foo ! 在您的libray中添加目录Foo In this directory add your classes. 在此目录中添加您的类。 the filename class will be Bar.php and class name will be Foo_Bar ! 文件名类将为Bar.php ,类名称将为Foo_Bar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM