[TYPO3-german] Extbase - Aufruf einer Controller-Methode in itemsProcFunc funktioniert nicht
Cedric Ziel
cedric at cedric-ziel.com
Wed Dec 4 14:50:13 CET 2013
Das ist der Punkt, auf den ich die ganze Zeit hinaus wollte. Der
Controller ist nicht voll funktionsfähig, weil es keinen Extbase Kontext
gibt.
Der Zugriff geht daher schief, weil aus diesem Grund das Repository nicht
injiziert wurde. Daher ist die Property nicht gesetzt und Du operierst auf
keinem Object.
Zitat von "JCL - Johannes C. Laxander" <jc at laxander.com>:
> Hi Georg,
>
>> Am 04.12.2013 11:15, schrieb JCL - Johannes C. Laxander:
>> ##### flexform.xml
>>
>> <itemsProcFunc>VENDOR\MyExtension\Controller\SubRegionController->find
>> InMainRegion()</itemsProcFunc>
>>
>> nicht immer alles auf dieses Extbase schieben.
>
> will ich gar nicht - ich will "nur" mein Problem losen und wissen wie's
> geht
> und es dann auch noch verstehen ;-)
>
>> gib mal die () raus, die haben da nix verloren.
>>
>> Die Funktion findInMainRegion()() {} gibts ja wirklich nicht
>
> Wo du recht hast, hast du recht!
> Das bedeutet auch, dass man als itemsProcFunc generell auch eine
> Controller-Action aufrufen kann, oder!?
>
> Jetzt bin ich wieder einen Schritt weiter und steh' vor dem nachsten
> Problem:
>
> --> Fatal error: Call to a member function findByMainRegionAssignment()
> on a
> non-object in ../SubRegionController.php on Line 112
>
> Das ist die Funktion, Line 112 habe ich rechts markiert:
> ---
> /**
> * action findInMainRegion sub regions that correspond to the selected
main
> region
> *
> * @return void
> */
> public function findInMainRegionAction() {
> $v = '2';
> $subRegions =
> $this->subRegionRepository->findByMainRegionAssignment($v); <--- Line
112
> $this->view->assign('subRegions', $subRegions);
> }
>
> Das betreffende Repository:
> ---
> class SubRegionRepository extends
> \TYPO3\CMS\Extbase\Persistence\Repository
> {
>
> }
>
> _______________________________________________
> TYPO3-german mailing list
>
TYPO3-german at lists.typo3.orghttp://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german
More information about the TYPO3-german
mailing list