Sasa,

I got it working by setting the default action to "index":

resources.router.routes.sitemap.route = "sitemap.xml"
resources.router.routes.sitemap.defaults.controller = "sitemap"
resources.router.routes.sitemap.defaults.action = "index"
resources.router.routes.sitemap.defaults.format = "xml"

Also, you shouldn't have to disable the layout in your index action. The
context switch will do this automatically. This will make it work with the
html context (which will need a layout, presumably).

Konr


On Fri, Feb 5, 2010 at 11:01 AM, umpirsky <[email protected]> wrote:

>
> Hi.
>
> I have sitemap controller
>
> <?php
> class SitemapController extends Zend_Controller_Action {
>        public function init() {
>                $this->_helper->contextSwitch
>                ->addActionContext('index', 'xml')
>                ->initContext();
>        }
>
>    public function indexAction() {
>        $this->view->layout()->disableLayout();
>    }
> }
>
> And I want to have xml and html version of sitemap.
>
> I added route
>
> resources.router.routes.sitemap.route = "sitemap.xml"
> resources.router.routes.sitemap.defaults.controller = "sitemap"
> resources.router.routes.sitemap.defaults.format = "xml"
>
> But when I visit http://test.com/sitemap.xml, i get html version.
>
> How can I pass format parameter to be xml and have sitemap.xml in my url.
>
> Regards,
> Sasa Stamenkvovic.
> --
> View this message in context:
> http://n4.nabble.com/Sitemap-route-tp1470493p1470493.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>

Reply via email to