Matthew Weier O'Phinney-3 wrote:
> 
> -- iceangel89 <[email protected]> wrote
>> and in general how do i create a mapping from 
>> 
>> resources.db.adapter = "pdo_mysql"
>> resources.db.params.host = "localhost"
>> resources.db.params.username = "root"
>> resources.db.params.password = ""
>> resources.db.params.dbname = "zf-ims"
>> 
>> to code like
>> 
>> new Zend_Db(...)?
>> 
>> is there documentation for this?
> 
> I'm not sure what you're gettting at. You cannot instantiate Zend_Db
> directly, and the Db resource creates your adapter for you already.
> 
> You can retrieve that adapter in a couple of ways:
> 
>   * From Zend_Db_Table_Abstract:
>     $db = Zend_Db_Table_Abstract::getDefaultAdapter();
> 
>   * Within your action controller, you can pull it from the bootstrap,
>     which is available as an invocation arg:
>     $bootstrap = $this->getInvokeArg('bootstrap');
>     $db = $bootstrap->getResource('db');
> 

i meant, like how do i know that resources.db will do something like $db =
Zend_Db::factory(...)

then resources.db.params. ... will set the 2nd args of the factory function?
with this infomation i can easily convert what we can do in Bootstrap.php
and put it in application.ini instead 

like now i didnt know that resources.router will refer to say the default
router

then resources.router.routes. will add a route etc?

-- 
View this message in context: 
http://www.nabble.com/Adding-routes-with-application.ini-tp23293676p23327916.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to