[TYPO3-mvc] Switchable ControllerActions + Tx_Extbase_Utility_Extension::configurePlugin()
Bader Paul
baderp at gmx.de
Sun Aug 7 16:41:08 CEST 2011
Hi List,
Maybe someone can me help.
As a Exampleextesion for me I will build a Plugin width List- and Singleview on two pages.
One Page width Listview and one Page width singleview.
1. I create the following Controller and the Plugin works fine on one page. It`s simple created by the ExtensionBuilder
/**
* Controller for the ListShow object
*/
class Tx_Listshow_Controller_ListShowController extends Tx_Extbase_MVC_Controller_ActionController {
/**
* @var Tx_Listshow_Domain_Repository_ListShowRepository
*/
protected $listShowRepository;
/**
* @param Tx_Listshow_Domain_Repository_ListShowRepository $listShowRepository
* @return void
*/
public function injectListShowRepository(Tx_Listshow_Domain_Repository_ListShowRepository $listShowRepository) {
$this->listShowRepository = $listShowRepository;
}
/**
* Displays all ListShows
*
* @return void
*/
public function listAction() {
$configuration = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
$listShows = $this->listShowRepository->findAll();
$this->view->assign('listShows', $listShows);
}
/**
* Displays a single ListShow
*
* @param Tx_Listshow_Domain_Model_ListShow $listShow the ListShow to display
* @return string The rendered view
*/
public function showAction(Tx_Listshow_Domain_Model_ListShow $listShow) {
$this->view->assign('listShow', $listShow);
}
}
?>
2.I create the following new Flexform.xml for the Plugin and the Plugin works fine.
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Optionen</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<switchableControllerActions>
<TCEforms>
<label>Plugin type</label>
<config>
<type>select</type>
<items type="array">
<numIndex index="1" type="array">
<numIndex index="0">Listen Ansicht</numIndex>
<numIndex index="1">ListShow->list</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">Detail Ansicht</numIndex>
<numIndex index="1">ListShow->show</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</switchableControllerActions>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
3. In my ext_tables.php I have the following code.
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
Tx_Extbase_Utility_Extension::registerPlugin(
$_EXTKEY,
'ListShow',
'listshow'
);
$pluginSignature = str_replace('_','',$_EXTKEY) . '_' . listshow;
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
t3lib_extMgm::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_' .listshow. '.xml');
4. In my ext_localconf.php I have the following Code.
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
Tx_Extbase_Utility_Extension::configurePlugin(
$_EXTKEY,
'Listshow',
array(
'ListShow' => 'list, show',
)
);
?>
5. When I look on the Page width the selected Listview Controller I get following Exeption.
#1295479650: The default controller can not be determined.
Please check for Tx_Extbase_Utility_Extension::configurePlugin() in your ext_localconf.php.
Sorry what is her wrong - Have anybody an idea.
Thanks for your help
Paul
More information about the TYPO3-project-typo3v4mvc
mailing list