0

Morning guys,

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

The CI default structure is

-application
-system

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

-application
-system
--resources
---phppdf
---images

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

4
Contributors
5
Replies
18
Views
3 Years
Discussion Span
Last Post by Tpojka
1

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'.

0

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.

0

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.

0

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

-application
-assets
--css
--img
--js
-system
.htaccess
index.php

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.