/**
  * Singleton instance
  *
  * @return Yaf_Dispatcher
  */
 public static function getInstance()
 {
     if (null === self::$_instance) {
         self::$_instance = new self();
         self::$_instance->setDefaultAction(Yaf_G::get('default_action'));
         self::$_instance->setDefaultController(Yaf_G::get('default_controller'));
         self::$_instance->setDefaultModule(Yaf_G::get('default_module'));
         self::$_instance->_router = new Yaf_Router();
     }
     return self::$_instance;
 }
 public function _initDefaultName(Yaf_Dispatcher $dispatcher)
 {
     /**
      * actully this is unecessary, since all the parameters here is the default value of Yaf
      */
     $dispatcher->setDefaultModule("Index")->setDefaultController("Index")->setDefaultAction("index");
 }
Beispiel #3
0
 public function testSetDefaultModule()
 {
     $app = new Yaf_Application(TEST_APPLICATION_PATH . 'conf/application.ini', 'production');
     $this->dispatcher = Yaf_Dispatcher::getInstance();
     $this->assertEquals('Index', $this->readAttribute($this->dispatcher, '_default_module'));
     $this->dispatcher->setDefaultModule('foo');
     $this->assertEquals('Foo', $this->readAttribute($this->dispatcher, '_default_module'));
     //set back to index
     $this->dispatcher->setDefaultModule('index');
 }
Beispiel #4
0
 public function _initDefaultName(Yaf_Dispatcher $dispatcher)
 {
     $dispatcher->setDefaultModule("Index")->setDefaultController("Index")->setDefaultAction("index");
 }
Beispiel #5
0
 public function _initDefaultName(Yaf_Dispatcher $dispatcher)
 {
     $dispatcher->setDefaultModule('Index')->setDefaultController('Index')->setDefaultAction('index');
 }