简体   繁体   中英

How to include custom folder in config in Zend Framework?

How to add include path to custom folder in application.ini in Zend Framework? 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

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

in Bootstrap.php

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

now you can use DATA_UPLOADS define in your script php! ;)


UPDATE

add this to application.ini

autoloadernamespaces[] = "Foo_"

in you libray add directory Foo ! In this directory add your classes. the filename class will be Bar.php and class name will be Foo_Bar !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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