[TYPO3-mvc] Backend Dispatcher available!

Xavier Perseguers typo3 at perseguers.ch
Fri Aug 7 19:46:58 CEST 2009


As said previously, changes are available in EXT:mvc_extjs. Thanks for your understanding.

> I'll test this in action ASAP. For now only some nitpicking:
> 
> Classes/BackendDispatcher.php:
> 
> line 79:
> $dispatcherParams = t3lib_div::_GP($argumentPrefix);
> should be
> $dispatcherParams = t3lib_div::_GPmerged($argumentPrefix);
> to be in sync with Extbase's future dispatcher ;)

done.

> lines 116 - 119, 152 - 154:
> I don't get it!?

Those lines are to support module functions. Perhaps you never programmed them yourself. It is some kind of module that integrates into another extension's menu. I created a sample module function in 
EXT:mvc_extjs_samples.

> lines 1 - 170:
> true/false => TRUE/FALSE

done.

> Classes/MVC/Web/Routing/URIBuilder.php:
> 
> line 172:
> return t3lib_div::linkThisUrl($typolinkConfiguration['parameter'], 
> $parameters);
> 
> Nice... After 10 years with TYPO3 I still keep discovering new methods 
> in t3lib_div ;)

:-)

> But is this really working? linkThisUrl() expects an URL and 
> $typolinkConfiguration['parameter'] would mostly contain the target PID, 
> no?

In my case, it mostly contains... mod.php ;-)

The code I proposed as draft for lines 159-168 could be easily made shorter. It was more to always get the "M" parameter (name of module) right after the question mark and to prevent having a URI 
query starting with an "&" as 'additionalParams' is always prefixed with & leading to URL like

mod.php?&someParameter=...&otherParameter=...

It works (is in place for many modules yet) but I did not like that!

In short. the else clause for TYPO3_MODE could be

$additionalParams = t3lib_div::trimExplode('&', $typolinkConfiguration['additionalParams'], TRUE);
$parameters = array();
foreach ($additionalParams as $params) {
	list($key, $value) = explode('=', $params);
	$parameters[$key] = $value;
}
return t3lib_div::linkThisUrl($typolinkConfiguration['parameter'], $parameters);

making it a bit more readable. I updated the associated patch in EXT:mvc_extjs/CorePatch

> And last but not least: The methods are reallly large. [...]

I refactored the class.

> - If you want to use your own implementation by extending the 
> dispatcher, you have to copy a whole lot of code even though you might 
> only want to change a minor thing.. And we hate duplicated code ;)

I made previously private method now protected to actually allow this...

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en

One contribution a day keeps the fork away


More information about the TYPO3-project-typo3v4mvc mailing list