Morning guys,

I would like someone to clarify my doubts with Codeigniter's file structure.

The CI default structure is


but I have a lot of other files in the same directory like, phppdf, images, etc
is it better to further separate them into another subdirectory for clarity such as


I'm like this better as it looks more organised, although it may mean rewriting the paths inside my controllers.

3 Years
Discussion Span
Last Post by Tpojka

Yes, feel free to add your own additional directories and subdirectories. For example, when your controllers call the views, instead of passing in just the name of the template file, such as 'foo', you can pass in 'directory/foo'.


Yes Dani I am definitely doing that within the views however, I am not doing that with my other resources or third party libraries.

I'm just sticking them in the root folder which I don't particularly like. Trouble is my application is growing so I guess I just have to bite the bullet and rewrite my controllers.


Yeah, I would just avoid putting files in folders like helpers, etc. where the framework searches through the directory and automatically includes classes in there that it finds.


Some practice I've met and started to use was to have folder named assets in the root:


Third party libraries are meant to be in application/third_party folder.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.