Jump to content

lysitheas

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by lysitheas

  1. Yeah, i know but the problem is users don't want to see lang parameter all the time. Only if language is changed except default and the only parameter that i'm worried is not lang, there are also a bunch of other parameters. I've started to write a plugin to check if controller exists but still i've concerns.
  2. Hi, I've currently urls like http://example.com/index/index/lang/EN/content/5. I want to remove controller and action if they both are index, like http://example.com/lang/EN/content/5. To do that i overrided url view helper and if both controller and action are index removed them. In error controller i wrote: $front = Zend_Controller_Front::getInstance(); $router = $front->getRouter(); $request = $front->getRequest(); $response = $front->getResponse(); $current_controller = $request->getParam('controller'); $current_action = $request->getParam('action'); $request->setParams(array($current_controller=>$current_action,'controller'=>'index','action'=>'index')); Zend_Controller_Front::getInstance()->getDispatcher()->dispatch($request, $response); If a controller and action can't be found, simply it's redirecting to the index/index and i'm setting the undefined controller as a parameter which is 'lang' here. But the problem is however it is setting 'lang' as a parameter, after dispatching again it disappears. So my url turns to /index/index/content/5. Do you know any solution to that or do you have any other suggestions to remove default controller and actions from the url?
×
×
  • 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.