The Cookbook»1.2 Collection»The Manual»Developing with CakePHP»Configuration»The Configuration Class»Configure Methods»read
{3887} - 3.4.3.1.2 read
read(string $key = 'debug')
Used to read configuration data from the application. Defaults to CakePHP’s important debug value. If a key is supplied, the data is returned. Using our examples from write() above, we can read that data back:
Configure::read('Company.name'); //yields: 'Pizza, Inc.'
Configure::read('Company.slogan'); //yields: 'Pizza for your body and soul'
Configure::read('Company');
//yields:
array('name' => 'Pizza, Inc.', 'slogan' => 'Pizza for your body and soul');
Configure::read('Company.name'); //yields: 'Pizza, Inc.'Configure::read('Company.slogan'); //yields: 'Pizza for your body and soul'Configure::read('Company');//yields:array('name' => 'Pizza, Inc.', 'slogan' => 'Pizza for your body and soul');
