Created
September 19, 2014 12:58
-
-
Save fabiopaiva/ab0369a81b95ccee1eb8 to your computer and use it in GitHub Desktop.
ZF2 global configuration
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( | |
'example' => array( | |
'foo' => 'bar' | |
) | |
); |
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 | |
namespace Application\Controller; | |
use Zend\Mvc\Controller\AbstractActionController; | |
class ExampleController extends AbstractActionController{ | |
public function indexAction() { | |
$config = $this->getServiceLocator()->get('Config'); | |
$example = $config['example']; | |
$foo = $example['foo']; | |
return array( | |
'foo' => $foo | |
); | |
} | |
} |
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
Foo: <?php echo $foo;?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment