just wondering what do these 2 lines do?
resources.router.routes.lab.defaults.id = 1
resources.router.routes.lab.reqs.id = "\d+"
Matthew Weier O'Phinney-3 wrote:
>
> -- iceangel89 <[email protected]> wrote
> (on Wednesday, 29 April 2009, 02:25 AM -0700):
>> how can i add routes to application.ini
>
> Based on what you have below,
>
> resources.router.routes.lab.route = "/lab/departments/edit/:id"
> resources.router.routes.lab.defaults.controller = departments
> resources.router.routes.lab.defaults.action = edit
> resources.router.routes.lab.defaults.id = 1
> resources.router.routes.lab.reqs.id = "\d+"
>
> should do it. Basically, with plugin resources, each resource has a key
> under "resources.", and the values under it are passed as options to the
> plugin resource. In this case, that's an array with a single key,
> "routes". In the Router resource, this is pased to Zend_Config, and then
> to the rewrite router to generate the routes.
>
>> 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 tried
>>
>> to add a route to lab module, departments controller, edit action like:
>>
>> routes.lab.route = "/lab/departments/edit/:id"
>> routes.lab.defaults.controller = departments
>> routes.lab.defaults.action = edit
>> routes.lab.defaults.id = 1
>> routes.lab.reqs.id = "\d+"
>>
>> i followed some other site tutorial. but it does not work. i get ... in
>> the
>> error controller
>>
>> Request Parameters:
>>
>> array(3) {
>> ["module"]=>
>> string(3) "lab"
>> ["controller"]=>
>> string(11) "departments"
>> ["action"]=>
>> string(4) "edit"
>> }
>>
>> so the id parameter is not there
>
> --
> Matthew Weier O'Phinney
> Project Lead | [email protected]
> Zend Framework | http://framework.zend.com/
>
>
--
View this message in context:
http://www.nabble.com/Adding-routes-with-application.ini-tp23293676p23461881.html
Sent from the Zend Framework mailing list archive at Nabble.com.