Hector, thank you for quick replies and giving attention to my little
troubles.
Sadfully, your first advise doesn't work. Here the error:
Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with
message 'Resource matching "front" not found' in
/home/zeliboba/dgb/library/Zend/Application/Bootstrap/BootstrapAbstract.php:690
Stack trace:
#0
/home/zeliboba/dgb/library/Zend/Application/Bootstrap/BootstrapAbstract.php(625):
Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('front')
#1
/home/zeliboba/dgb/library/Zend/Application/Bootstrap/BootstrapAbstract.php(582):
Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap('front')
#2 /home/zeliboba/dgb/application/Bootstrap.php(117):
Zend_Application_Bootstrap_BootstrapAbstract->bootstrap('front')
#3
/home/zeliboba/dgb/library/Zend/Application/Bootstrap/BootstrapAbstract.php(665):
Bootstrap->_initRouters()
#4
/home/zeliboba/dgb/library/Zend/Application/Bootstrap/BootstrapAbstract.php(618):
Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('routers')
#5
/home/zeliboba/dgb/library/Zend/Application/Bootstrap/BootstrapAbstract.php(582):
Zend_Application_Bootstrap_BootstrapA in
/home/zeliboba/dgb/library/Zend/Application/Bootstrap/BootstrapAbstract.php
on line 690
On 117 line of my bootstrap.php I has:
$this->bootstrap( 'front' );
as you recommended
Fine is that second recommendation seem to be work.
>From url:
http://localhost/products/wedding/2009/10/12/
I am catching params:
array(5) {
["year"]=> string(4) "2009"
["month"]=> string(2) "10"
["day"]=> string(2) "12"
["controller"]=> string(8) "products"
["action"]=> string(7) "wedding"
}
I am falling in some another error then, but this is out of this topic.
Anyway I am interested of provided way to solve this task. Is there any new
ideas how to launch custom router concrete from bootstrap, not
application.ini?
Hector Virgen wrote:
>
> Instead of:
>
> $front = Zend_Controller_Front::getInstance();
>
> Try:
>
> $this->bootstrap('front');
> $front = $this->getResource('front');
>
> It may be that your front controller is reset when it is initialized (an
> empty router may be injected). Not sure about this but it's worth a try.
>
> Also, there is a built-in resource for the router that might be easier to
> work with. Try commenting out your _initRouter() bootstrap method and
> adding
> these lines to your application.ini:
>
> resources.router.routes.wedding.type = "Zend_Controller_Router_Route"
> resources.router.routes.wedding.route =
> "products/wedding/:year/:month/:day"
> resources.router.routes.wedding.defaults.controller = "products"
> resources.router.routes.wedding.defaults.action = "wedding"
> resources.router.routes.wedding.reqs.year = "\d+"
> resources.router.routes.wedding.reqs.month = "\d+"
>
> I hope this helps.
>
> --
> Hector
>
>
> On Tue, Mar 23, 2010 at 11:16 AM, zeliboba <[email protected]> wrote:
>
>>
>> Sorry, mistake in description. Right name of controller is 'products'.
>> Current url is:
>> http://localhost/products/wedding/year/2009/month/10/day/12
>> Needed is:
>> http://localhost/products/wedding/2009/10/12
>> --
>> View this message in context:
>> http://n4.nabble.com/Default-router-still-goes-ahead-of-custom-tp1679098p1679485.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>
>
--
View this message in context:
http://n4.nabble.com/Default-router-still-goes-ahead-of-custom-tp1679098p1679552.html
Sent from the Zend Framework mailing list archive at Nabble.com.