-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable Expanding #1
Comments
Actually, the usage is a little bit different. Each [section] creates a new object or array, and variable expanding works only for variables outside sections. I would probably write something like this:
And then:
In this sample, the keys outside sections acts as variables that you can use elsewhere. The [sections] represent objects, so [pdoConnection PDO] means $pdoConnection = new PDO. The keys for each section are parameters for that object. They can be constructor params, properties or method calls. The PDO object for example has a constructor with the params $dsn, $username and $password. Respect\Config then uses the keys inside the config section to instantiate that object. The usage is similar to PHP itself, but the main advantage is that every object declaration is lazy loaded. The PDO connection will only start when you try to get it from the container. Let me know if I can help you with anything else. Thanks! |
thanks! :) |
Currently config like this in php.ini:
returns php notice errors of undefined indexes. and in the end
db_dsn => :host=;dbname=
db_server => ://:@/
The text was updated successfully, but these errors were encountered: