[TYPO3-mvc] t3lib_extMgm::insertModuleFunction supported?
Xavier Perseguers
typo3 at perseguers.ch
Fri Oct 23 21:41:04 CEST 2009
Hi,
Here is some work progress to integrate an Extbase module within a standard module's function menu. This certainly works too for Extbase within Extbase modules but I have no sample code of pure
Extbase (ie non mvc_extjs-based BE module) at the moment.
First of all, I have to go back to revision 1479 of Extbase/Classes/Dispatcher.php otherwise I get same error as the one I reported on 21/10/2009 in thread "injectReflectionService() recent changes?":
#1: PHP Catchable Fatal Error: Argument 1 passed to Tx_Extbase_Persistence_Mapper_DataMapper::injectReflectionService() must be an instance of Tx_Extbase_Reflection_Service, null given, called in
/path/to/extbase/Classes/Dispatcher.php on line 246 and defined in /path/to/extbase/Classes/Persistence/Mapper/DataMapper.php line 115
I certainly made something wrong here but this time I did not have to use another DataMapper, just plain Extbase :-)
This is typically done by:
$ cd /path/to/extbase
$ svn -r 1479 update Classes/Dispatcher.php
Then apply patch Extbase_Classes_Utility_Extension.diff to get new method Tx_Extbase_Utility_Extension::registerModuleFunction.
You'll need a new base class for your own module function classes: copy FunctionActionController.php to Extbase/Classes/MVC/Controller/
That's all (at least for the moment) with Extbase modifications. No Core modification seems to be needed (which is great).
Now in your own extension, create a Controller for your ModuleFunction
class Tx_YourExt_Controller_TestController extends Tx_Extbase_MVC_Controller_FunctionActionController {
public function defaultAction() {
// Do your stuff here
}
}
And register your module function within ext_tables.php (I will extend Web > Info function menu here):
Tx_Extbase_Utility_Extension::registerModuleFunction(
$_EXTKEY,
'web_info', // Insert module function into function menu of Web > Info
array(
'Test' => 'default',
),
array(
'title' => 'My Extbase Function', // LLL:EXT: syntax supported
'menuKey' => 'function',
'workspaces' => '',
)
);
As said, this is ongoing work. Comments and suggestions on this would be great.
--
Xavier Perseguers
http://xavier.perseguers.ch/en
One contribution a day keeps the fork away
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Extbase_Classes_Utility_Extension.diff
URL: <http://lists.typo3.org/pipermail/typo3-project-typo3v4mvc/attachments/20091023/fba0c55f/attachment.txt>
More information about the TYPO3-project-typo3v4mvc
mailing list