Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen:
Using ZendConfig with a Slim app
Apr 21, 2015 @ 14:11:31

Rob Allen has a quick post to his site continuing his theme of Slim framework-related posts with this new post showing how to use the ZendConfig module with a Slim application.

Sometimes you need more configuration flexibility for your application than a single array. In these situations, I use the ZendConfig component which I install via composer: composer require "zendframework/zend-config". This will install the ZendConfig component, along with its dependency ZendStdlib.

He shows how to use the glob function to have the component load a set of configuration files and the order they'd load in. He also points out that the ZendConfig component supports other formats including YAML and JSON data. He also includes a code example showing how you can load multiple formats at the same time (ex. some .php files and some .yml files with one call).

tagged: slim application zendframework2 config component zendconfig tutorial introduction

Link: http://akrabat.com/using-zendconfig-with-a-slim-application/


Trending Topics: