Mecha CMS

Get states data.

$state->__construct()

Constructor.

State($input = [], $lot = []);

Example:

Convert $config_a array into safe object:

$config_a = require STATE . DS . 'config.php';
$config_o = new State($config_a);

Result:

echo $config_a['title']; // key `title` does exist, return the `title` value
echo $config_a['xyz']; // key `xyz` does not exist, broken!
echo $config_o->title; // key `title` does exist, return the `title` value
echo $config_o->xyz; // key `xyz` does not exist, return `null`