简体   繁体   中英

How to create a custom Zend Framework folder structure

I am trying to get ZendFramework but I don't want to use the deep complex folder structure (which is too complex for the application I am writing.

How can I make ZF with my own custom folder structure? I've found on google people discussing about the different alternatives but I can't find a way to create a new project with my folder structure.

I need to keep it simple.. not sure exactly on all the details but something such as

-Confiiguration

-Models

-Modules

--Module A

----Controller

----Views

--Module B

----Controller

----Views

--Etc.

To be honest, I don't know how that is so much simpler than the new standard folder structure. You will need a library folder too, since you won't make it without extending a single ZF class. Then you'll need a public folder too and in the end you're almost at the default layout. The main advantage of that would be that you can create new elements in the shell with zend tool (cli).

If you can't be convinced of using the standard solution, go ahead and implement the one you've posted. What's the problem with it? ZF doesn't give you any kind of constraints on how to build your folder structure, the configuration/bootsrapping is what binds it all together into a working whole.

With one exception... if you extend the library, you should use the ZF naming/folder conventions.

Take a look at the routing stuff that Zend offers, you should be able to adjust the directory structure however you want. With a combination of the and the set_include_path function, this shouldnt be too difficult

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