Last active
September 4, 2015 13:50
-
-
Save kjohnson/a12740576c56ffaabe96 to your computer and use it in GitHub Desktop.
Loading configuration arrays from another file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Foo | |
{ | |
protected $_settings = array(); | |
public function __construct() | |
{ | |
$this->_settings = include 'config.php'; | |
} | |
public function getSettings() | |
{ | |
return $this->_settings; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'a' => 'aye', | |
'b' => 'bee', | |
'c' => 'see' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment