CodeIgniter Forums
system and application folder paths - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: system and application folder paths (/showthread.php?tid=23735)



system and application folder paths - El Forum - 10-20-2009

[eluser]nmormino[/eluser]
Is there a way to access the $system_folder and $application_folder from within a controller in order to build path to a particular file?

ex.
Code:
$file_path = $system_folder.'/'.$application_folder.'/views/';



system and application folder paths - El Forum - 10-20-2009

[eluser]pistolPete[/eluser]
Have a look at the constants defined in index.php:
Code:
/*
|---------------------------------------------------------------
| DEFINE APPLICATION CONSTANTS
|---------------------------------------------------------------
|
| EXT        - The file extension.  Typically ".php"
| SELF        - The name of THIS file (typically "index.php")
| FCPATH    - The full server path to THIS file
| BASEPATH    - The full server path to the "system" folder
| APPPATH    - The full server path to the "application" folder
|
*/



system and application folder paths - El Forum - 10-20-2009

[eluser]nmormino[/eluser]
yeah that's what I did, thanks for the info. I added this to my config file so I could have a relative path.
Code:
$config['relative_path']    = str_replace($_SERVER['DOCUMENT_ROOT'], '', APPPATH);