Following is the app architecture:

    |  (contains definition of App ROOT)

Problem: I am not understanding how to call config file so as to set and access App Root.

In Config File - I have defined Constant -> MY_APP_ROOT

Now, I wish to access all Application Folders with the help of MY_APP_ROOT.

Could you please help?
Thank you friends.

Recommended Answers

All 3 Replies

Member Avatar

I'm assuming there is nothing fancy going on here. Frameworks like CI, laravel probably just access the config file as you would normally, so you would pass in the path to the directory relative or absolute... take your pick.

Include or required the config file where ever you need it. require($_SERVER['DOCUMENT_ROOT'] . '/application/config/');

Member Avatar

So accessing application folders thereafter...
If using Gabriel's require...

$library = MY_APP_ROOT. '/library/'; 

Is that what you're looking for?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.