2

Informatik (Subject) / Reminders (Lesson)

Kurze Erinnerungen, die ich nicht vergessen sollte

This lesson was created by kartenchris.

Learn lesson

This lesson is not released for learning.

  • Bitte nochmal das Objekt-Framework in Typo3 Flow ansehen. URL ist auf der Rückseite. Auf jeden Fall ansehen, wenn ich dann selbst anfange zu programmieren. http://docs.typo3.org/flow/TYPO3FlowDocumentation/TheDefinitiveGuide/PartIII/ObjectManagement.html   Was ich auf jeden Fall mal brauchen werde ist, die Konfiguration des Objekts bei Dependency Injection:  http://docs.typo3.org/flow/TYPO3FlowDocumentation/TheDefinitiveGuide/PartIII/ObjectManagement.html#constructor-injection
  • Subrequests muss man selten einbauen in Typo3 Flow. http://docs.typo3.org/flow/TYPO3FlowDocumentation/TheDefinitiveGuide/PartIII/ModelViewController.html Creation of an ActionRequest as a subrequest of an HTTP request:$actionRequest = $httpRequest->createActionRequest(); // you rarely need to do that. An ActionRequest always holds a reference to a parent request. It is easy to retrieve it in the controller via:$parentRequest = $this->request->getParentRequest();// in case of a shallow hierarchy, $parentRequest = $this->request->getHttpRequest(); In case of widgets, plugins or other inline elements of a rendered page:Each element (plugin, widget, etc.) needs its own ActionRequest in order to keep track of invocation details like arguments and other context information:Here an ActionRequest can be a sub request of another ActionRequest:$subRequest = new ActionRequest($parentRequest); The top level Action Request (just below the HTTP Request) is referred to as the Main Request:public function fooAction() { $parentRequest = $this->request->getParentRequest();$httpRequest = $this->request->getHttpRequest();$mainRequest = $this->request->getMainRequest();if ($this->request === $mainRequest) { $message = "This is the main request.';}           if ($this->request->isMainRequest()) {                $message = 'This is the main request';           } } Manual creation of sub requests is rarely necessary. In most cases the framework will take care of creating and managing sub requests if plugins or widgets are in the game.