Pergunta

I'm using extbase, fluid system on typo3 to build a backend module. I Have a Controller "MainController" action called 'AddBoxes' and I have another Controller called BoxElementsController, and there is an action method called 'popupBoxAction'.

I want to render the output of the BoxElementsController->popupBoxAction in the MainController-AddBoxesAction();

so that I can assign the output to my view variable.

How can i achieve this in Typo3 6.1.

Thanks

Foi útil?

Solução 2

Try to instantiate you controller in you action then call ControllerObject->initializeAction() before calling your desired action.

Outras dicas

Also you can fetch data or output whatever you like from BoxElementsRepository

class MainController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {

   protected $boxElementsRepository;

   public function injectBoxElementsRepository(BoxElementsRepository $boxElementsRepository) {
        $this->boxElementsRepository = $boxElementsRepository;
   }

   public function AddBoxesAction(){
        $popupBoxActionOutput = $this->boxElementsRepository->popupBox();
        $addBoxesAction = $this->mainRepository->findAll();


        $this->view->assignMultiple(array(
            'popupBoxActionOutput' => $popupBoxActionOutput,
            'addBoxesAction' => $addBoxesAction,
    ));
   }
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top