Skip to content

Global Variables and Config

Niamul Hasan edited this page Dec 29, 2020 · 3 revisions

Global variables and configuration is done in

corex/autoload.php file

The config and global varibles array looks like this:

corex/autoload.php

...
...
$GLOBALS['config'] = array(
    'mysql' => array(
        'host'      => 'localhost',
        'username'  => 'root',
        'password'  => '',
        'database'  => 'corex_israt',
        'charset'   => 'utf8',
    ),
    'app_variables' => array(
        'app_title' => "phpCoreX",
        'root_url'   => 'phpCoreXisrat',
    ),
    'remember' => array(
        'cookie_name'   => 'hash',
        'cookie_expiry' => 604800
    ),
    'session' => array(
        'session_name' => 'user',
        'token_name'   => 'token'
    )
);
...
...

in this array you can add your custom items as well

Accessing global variables

Config::get('mysql/host')
Clone this wiki locally