Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Figured it out by tracing through CI. Turns out you can't do this. You can put your own controllers in a subdirectory of /application/controllers, but you cannot put them someplace else: in particular, as <a href="http://codeigniter.com/user_guide/libraries/loader.html" rel="nofollow">http://codeigniter.com/user_guide/libraries/loader.html</a> implies,</p> <blockquote> <p>These elements can be libraries (classes) View files, Helpers, Models, or your own files.</p> </blockquote> <p>"Your own files" not including controllers. I ended up being able to get it to look to the ENVIRONMENT setting in addition to APPPATH by making changes to CodeIgniter.php and Router.php. I don't like making this kind of change, however, so I backed out the changes. I'll put this here in case somebody else can benefit from it.</p> <p>Router.php change:</p> <pre><code>function _validate_request($segments) { ... // Does the requested controller exist in the root folder? if (file_exists(APPPATH.'controllers/'.$segments[0].'.php') || file_exists(ENVIRONMENT.'/controllers/'.$segments[0].'.php')) // New bit here { return $segments; } .... } </code></pre> <p>CodeIgniter.php change, 'round about line 246:</p> <pre><code>if ( ! file_exists(APPPATH.'controllers/'.$RTR-&gt;fetch_directory().$RTR-&gt;fetch_class().'.php')) { // New bit here if ( ! file_exists(ENVIRONMENT.'/controllers/'.$RTR-&gt;fetch_directory().$RTR-&gt;fetch_class().'.php')) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } include(ENVIRONMENT.'/controllers/'.$RTR-&gt;fetch_directory().$RTR-&gt;fetch_class().'.php'); } else { include(APPPATH.'controllers/'.$RTR-&gt;fetch_directory().$RTR-&gt;fetch_class().'.php'); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload