I am working on a project in Zend Framework in which the logged in users must have a public profile page. For Example,
http://www.example.com/user_x
But when i searched Google regarding this, i couldn’t find a solution. As i know in Zend, all pages will come only under the ‘public’ folder.That is, every zend Url is following the below format,
http://www.example.com/public/controller/action
So, how to create a URL to a users profile with Dynamic Contents from Database?
Can anyone help me? I am Using ZF 1.11 !
The default ZF routes give you URLs in the format:
If you have ‘public’ at the start of your URLs then there is something wrong with your vhost setup (make sure your document root points at the public folder, not the root of your project).
To answer your query, you can setup a custom route to allow your user profile URLs, but if you want the username to be at the start of the URL you need to do this in a way that won’t break other routes. I wrote a blog post about doing this specific scenario a while back, see: http://tfountain.co.uk/blog/2010/9/9/vanity-urls-zend-framework