简体   繁体   中英

Defining Custom Paths On Index.php Codeigniter

Is it possible to define your own paths in the index.php of codeigniter. Because I have a few other locations that need to have there own directory path name.

If I place these in the main index.php should these work. Or is there some thing else I need to do.

define('DIR_APPLICATION', 'APPPATH'); // Location To APPPATH

define('DIR_SYSTEM', 'BASEPATH'); // Location To SYSTEMS

define('DIR_TEMPLATE', 'APPPATH' . 'views/theme/'); // Location To Template

define('DIR_IMAGE', 'FCPATH' . '/image/'); // Location To IMAGE DIR 

define('DIR_DOWNLOAD', 'FCPATH' . '/download/'); // Location To Downloads

Personally, I try not to edit the index.php. Although adding them to the file would work.

I would create a "bootstrap" library (which is autoloaded), to define these.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM