0

So I have a database table called configs that has the following columns - key and value.

The key looks like so 'core/database/params/username' and the value is 'root'. I want to be able to access this from a Zend_Config object using $config->core->database->params->username. Any ideas how to solve this?

1 Answer 1

1

Create your custom class My_Config_Database extending Zend_Config and implement any logic you want ;) Zend_Config_Ini is easy to understand and refactor for your needs ;)

Sign up to request clarification or add additional context in comments.

2 Comments

You're welcome. You might consider caching the resulting config, because the config generation might be a bottleneck (if you're not lazy-loading the values)
I am planning on doing that. Thanks again for the assistance!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.