Advanced Config Options

Debugging

$config['debug'] = false;
$config['debugHide'] = false;

These options are for helping you problem solve if the router doesn't seem to be finding your controller. The "hide" option just makes the routing messages show up in the HTML comments.

Case-Sensitivity

$config['lowercase_url'] = true;

By default Cora converts URLs into lowercase so that you can have consistent behavior on case-sensitive servers (e.g. Linux systems) regardless of whether or not a user types capital letters into the URL. However, if you wanted your URLs to be case-sensitive, you can disable this option in the config.

Default Controller

$config['default_controller'] = 'Home';

If a user just goes to your homepage 'www.mysite.com`, what controller should this request be routed to? You can set that here.

RESTful Routing

$config['enable_RESTful'] = true;

We'd recommend against it, but if you want to turn off RESTful routing in Cora, you may do so. To learn more about how routing works within Cora, see HERE.

File Paths

$config['basedir'] = dirname(__FILE__).'/../../../../../';

/**
 *  Path to models/classes directory relative to this file.
 */
$config['pathToModels'] = $config['basedir'].'classes/';

/**
 *  Path to views directory relative to this file.
 */
$config['pathToViews'] = $config['basedir'].'views/';

/**
 *  Path to controllers directory relative to this file.
 */
$config['pathToControllers'] = $config['basedir'].'controllers/';

/**
 *  Path to libraries directory relative to this file.
 */
$config['pathToLibraries'] = $config['basedir'].'libraries/';

/**
 *  Path to events directory relative to this file.
 */
$config['pathToEvents'] = $config['basedir'].'events/';

/**
 *  Path to listeners directory relative to this file.
 */
$config['pathToListeners'] = $config['basedir'].'listeners/';

/**
 *  Path to App's Cora directory relative to this file.
 */
$config['pathToCora'] = $config['basedir'].'cora/';

By default all these folders are set to be in your project's root - on the same level as the 'vendor' directory. However, you can obviously change this however you want. Another thing to take special notice of is that the folder names themselves are defined here and can be changed. This might come in useful if you are integrating Cora into an existing software project that already has its class files located in a specific directory somewhere.

File Naming Conventions

/**
 *  Model/Class file prefix. I.e. If your class files are named "class.MyClass.inc.php"
 *  then enter 'class.' for Prefix and '.inc' for postfix.
 */
$config['modelsPrefix'] = 'class.';
$config['modelsPostfix'] = '';

/**
 *  View file prefix / postfix.
 */
$config['viewsPrefix'] = 'view.';
$config['viewsPostfix'] = '';

/**
 *  Controller file prefix / postfix.
 */
$config['controllersPrefix'] = 'controller.';
$config['controllersPostfix'] = '';

/**
 *  Library file prefix / postfix.
 */
$config['librariesPrefix'] = '';
$config['librariesPostfix'] = '';

/**
 *  Event file prefix / postfix.
 */
$config['eventsPrefix'] = 'event.';
$config['eventsPostfix'] = '';

/**
 *  Listener file prefix / postfix.
 */
$config['listenerPrefix'] = 'listen.';
$config['listenerPostfix'] = '';

Here you can set optional prefix and postfix naming conventions for your files. For instance, if your views are named "view.someView.php", you tell Cora about that "view." prefix here and then you don't have to worry about the prefix or postfix in your controllers. For example: you would be able to load the above view by

$this->load->view('someView');