예제 #1
0
파일: List.php 프로젝트: samuelsweet/xf
 protected function _preDispatch($action)
 {
     $this->_type = $this->_getTypeModel()->getById($this->getRequest()->getParam('type_id', 0));
     if (!$this->_type) {
         $this->_type = $this->_getTypeModel()->getDefault();
     }
     parent::_preDispatch($action);
 }
예제 #2
0
파일: Item.php 프로젝트: samuelsweet/xf
 protected function _preDispatch($action)
 {
     switch (strtolower($this->getRouteMatch()->getAction())) {
         case 'create':
         case 'save':
             $this->_item = [];
             $this->_type = $this->_getTypeModel()->getById($this->getRequest()->getParam('type_id', 1));
             break;
         default:
             $this->_item = $this->_getListModel()->getById($this->getRequest()->getParam('listing_id', 0));
             $this->_type = $this->_getTypeModel()->getById($this->_item['listing_type_id']);
             break;
     }
     parent::_preDispatch($action);
 }