De handleiding»Ontwikkelen met CakePHP»Configuratie»De configuratie klasse»Methoden in Configure»load
3.4.3.1.4 load
load(string $path)
Gebruik deze methode om configuratie informatie te laden uit een specifiek bestand.
// /app/config/messages.php:
<?php
$config['Company']['name'] = 'Pizza, Inc.';
$config['Company']['slogan'] = 'Pizza for your body and soul';
$config['Company']['phone'] = '555-55-55';
?>
<?php
Configure::load('messages');
Configure::read('Company.name');
?>
// /app/config/messages.php:<?php$config['Company']['name'] = 'Pizza, Inc.';$config['Company']['slogan'] = 'Pizza for your body and soul';$config['Company']['phone'] = '555-55-55';?><?phpConfigure::load('messages');Configure::read('Company.name');?>
merk op dat ieder key-value is gerepresenteerd in het bestand met de $config array. Elke andere variabele in dat bestand wordt genegeerd door de load() functie.
See comments for this section
