Changeset 2534
- Timestamp:
- 06/24/08 12:34:17 (7 months ago)
- Location:
- branches/0.11
- Files:
-
- 3 modified
-
CHANGELOG (modified) (1 diff)
-
src/controller/AgaviController.class.php (modified) (1 diff)
-
src/routing/AgaviRouting.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/CHANGELOG
r2533 r2534 12 12 ADD: Allow nested routing structures with concatenated name or action attributes in ancestors other than immediate parents (Dominik) (#764) 13 13 14 CHG: AgaviController::dispatch() should accept module and action names in the request data argument with routing disabled (#776) (David) 14 15 CHG: Routing should not just bail out of execute() if routing is enabled, but no routes are defined (#779) (David) 15 16 CHG: Refactor AgaviContext::initialize() and the passing of "profile" (#778) (David) -
branches/0.11/src/controller/AgaviController.class.php
r2528 r2534 163 163 try { 164 164 165 $rq = $this->context->getRequest(); 166 $rd = $rq->getRequestData(); 167 165 168 // match routes and assign returned initial execution container 166 169 $container = $this->context->getRouting()->execute(); 167 170 168 171 // merge in any arguments given. they need to have precedence over what the routing found 169 $requestData = $this->context->getRequest()->getRequestData();170 172 if($arguments !== null) { 171 $r equestData->merge($arguments);173 $rd->merge($arguments); 172 174 } 173 175 176 // next, we have to see if the routing did anything useful, i.e. whether or not it was enabled. 174 177 $moduleName = $container->getModuleName(); 175 178 $actionName = $container->getActionName(); 176 177 if($moduleName == null) { 178 // no module has been specified 179 $container->setModuleName(AgaviConfig::get('actions.default_module')); 180 $container->setActionName(AgaviConfig::get('actions.default_action')); 179 if(!$moduleName) { 180 // no module has been specified; that means the routing did not run, as it would otherwise have the 404 action's module name 181 182 // lets see if our request data has values for module and action 183 $ma = $rq->getParameter('module_accessor'); 184 $aa = $rq->getParameter('action_accessor'); 185 if($rd->hasParameter($ma) && $rd->hasParameter($aa)) { 186 // yup. grab those 187 $moduleName = $rd->getParameter($ma); 188 $actionName = $rd->getParameter($aa); 189 } else { 190 // nope. then its time for the default action 191 $moduleName = AgaviConfig::get('actions.default_module'); 192 $actionName = AgaviConfig::get('actions.default_action'); 193 } 194 195 // so by now we hopefully have something reasonable for module and action names - let's set them on the container 196 $container->setModuleName($moduleName); 197 $container->setActionName($actionName); 181 198 } 182 199 -
branches/0.11/src/routing/AgaviRouting.class.php
r2531 r2534 677 677 678 678 if(!AgaviConfig::get('core.use_routing', false)) { 679 // routing disabled, determine module and action manually and bail out 680 $container->setModuleName($reqData->getParameter($req->getParameter('module_accessor'))); 681 $container->setActionName($reqData->getParameter($req->getParameter('action_accessor'))); 682 679 // routing disabled, just bail out here 683 680 return $container; 684 681 }

