Jump to content

Archived

This topic is now archived and is closed to further replies.

LemonInflux

Zend Framework Help

Recommended Posts

Hey.

 

I've been playing around with the framework a bit. I have a few questions to ask that I need clearing up...

1) How do I pass URL variables? ($_GET)

2) Say I have all my pages in my index controller. So all of the pages are in mysite.com/index. E.g. mysite.com/index/index/, mysite.com/index/about/ etc. How do I change this to mysite.com/index/, mysite.com/about/ etc? I know it's probably with Zend_Controller_Router_Rewrite, but I'd like an example or some help.

 

Thanks

 

----------------

Now playing: Linkin Park - One Step Closer

via FoxyTunes

Share this post


Link to post
Share on other sites

Set index as the default controller, (which it should be by default).

 

mysite.com/index or mysite.com/about will call mysite.com/index/index or mysite.com/index/about

Share this post


Link to post
Share on other sites

$front->setParam('useDefaultControllerAlways', true); ?

No to set the default controller you use

$front->setDefaultControllerName('index')

In you your "bootstrapper" (before your call $front->dispatch())

 

However the above should not be necessary, as zend should call the index controller (or action) by default if its not specified in the url. To test go to mysite.com, and Zend should call the indexAction within the indexController automatically without you specifying it in the url.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.