php - what is your method of directories with in a root -


ive has created an MVC which has this level of organization as far as folders and settings are in the file. - [class] - list of PHP classes - [contains this] - config.phip - functions.php php function) --root --- [js] [css] [images] [class] - list of php squares - [contains] - config.php (includes DB connection string - functions. Php (php function)


I have problems with this structure as you can see that the class, function, and a DB configured in the administration section The Shan file has its own folder.

Then there is a set of pages for the root category, function, and DB connection (which is similar to the administrator) for other pages

Ive tried only one folder for classes and included it for the second and the admin section and the root page are all shares but the result is included as a spider.

< P> include_once (dirname ( FILE ) ./ directory / ...) and other What if IM and Im are trying to include a file inside a folder that has a level in the current page which does not work and instead of using the main root directory also includes inside the folder IM So it does not come for any good use.

So if this was my original: d: / wamp / www / website / and I was included in the file within the directory named main functions from the main root, ( FILE ) The pass really should be the value of D: \ wamp \ www \ website \ functions \

, which is a good way to include files included in the error of errors

thanks < / P>

Try to do something like that, and define it in the central config file You can.

This will give a single stability to all your paths, then define some other constants, possibly associated with the proper file path, for each folder as a ROOT_CLASSES and ADMIN_CLASSES. Then it's really just to include the stuff. Just describe it with continuous and add a file name.

 Define ("ABS_PATH", "/ path / to / top / most / directory"); // Manual // Define other paths ... Define ("ADMINX", ABS_PATH. "/ Admin / class /"); Define ("ROOT_CLASSES", ABS_PATH. "/ Root / classes /"); (ROOT_CLASSES "/ myclass.php".); 

If it is in the config file, with other announcements, you do not have to worry about defining them later.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -