logo       

Re: how to handle dynamic urls: msg#00160

php.zend.framework.mvc

Subject: Re: how to handle dynamic urls

I usually specify my routes in a config file as described in the manual:

http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.add-config

e.g.,

routes.archive.route = ":storeName/products/viewAll"
routes.archive.defaults.controller = products
routes.archive.defaults.action = viewAll

so www.domain.com/stores/Some_Dynamic_Store_Name/products/vewAll would go to ProductsController::viewAll w/ storeName == 'Some_Dynamic_Store_Name' (assuming stores/ is the root path of your app and you have no modules specified)

-L

On Fri, Jul 25, 2008 at 9:51 PM, whisperstream <junk-EAADADZgbbc@xxxxxxxxxxxxxxxx> wrote:

I'm pretty new to MVC but have an implementation question

I'm building a site that will use unique URLs per account

e.g. www.domain.com/stores/Some_Dynamic_Store_Name/products/vewAll
www.domain.com/stores/Some_Other_Dynamic_Store_Name/admin
www.domain.com/stores/Some_Third_Dynamic_Store_Name/customers

and some will just be normal

www.domain.com/index/contactUs

how do I handle those URLs so that I can implement an MVC solution, do I
need to write my own router extension or do I need to use some sort of
.htaccess rewrite?

Just wondering if there's a best practices or what the best way of doing
this is as from what I can see in the MVC method, the first part of the URL
specifies controller and action and I need to handle all cases.
--
View this message in context: http://www.nabble.com/how-to-handle-dynamic-urls-tp18662550p18662550.html
Sent from the Zend MVC mailing list archive at Nabble.com.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise