/**
  * @group ZF-10364
  */
 public function testGotoSimpleDefaultModuleRedirectsToDefaultModule()
 {
     $this->controller->getFrontController()->setDefaultModule('test')->setDefaultControllerName('test')->setDefaultAction('test');
     $this->redirector->gotoSimple('test', 'test', 'test');
     $result = $this->redirector->getRedirectUrl();
     $expected = '/';
     $this->assertEquals($expected, $result);
     $this->redirector->gotoSimple('index', 'index', 'default');
     $result = $this->redirector->getRedirectUrl();
     $expected = '/default/index/index';
     $this->assertEquals($expected, $result);
 }
Пример #2
0
 public function init()
 {
     parent::init();
     $this->log = Zend_Registry::get('log');
     $this->session = new Zend_Session_Namespace("identify");
     $mouduleName = parent::getFrontController()->getRequest()->getModuleName();
     if ($mouduleName == 'admin') {
         $this->session = new Zend_Session_Namespace("admin");
         if ($this->session->admin != null) {
             $this->view->placeholder('admin')->exchangeArray($this->session->admin);
         } else {
             $this->view->placeholder('admin')->exchangeArray(array());
         }
     } else {
         $this->session = new Zend_Session_Namespace("user");
         if ($this->session->user != null) {
             $this->view->placeholder('user')->exchangeArray($this->session->user);
         } else {
             $this->view->placeholder('user')->exchangeArray(array());
         }
     }
 }