[英]Codeigniter - switch root folder
As I know, the root folder for a codeigniter app is set in "ci.php" with the $application_folder
variable. 据我所知,codeigniter应用程序的根文件夹是在
$application_folder
ci_php中使用$application_folder
变量设置的。
Is it possible to change this variable dynamically ? 是否可以动态更改此变量?
For example at at some point, in some controller, I want to switch the root dir from "main_root" folder to "another_root" folder ? 例如,在某个时候,在某个控制器中,我想将根目录从“ main_root”文件夹切换到“ another_root”文件夹吗?
The application folder is set in the index.php, for example: 应用程序文件夹在index.php中设置,例如:
$application_folder = '../application';
That is the best place to change it dynamically. 那是动态更改它的最佳位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.