GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Quiz

4.2 Extbase Controllers and Actions

Gelöschter Nutzer 19 Fragen Aktualisiert am 27 Apr 2022

Quiz starten

Fragen in diesem Quiz (19)

  1. 1Which statements about Extbase controllers are correct? (2)
    1. AExtbase controllers are always interfaces
    2. BEvery controller must directly extend the basis controller
      TYPO3\CMS\Extbase\Mvc\Controller\ActionController
    3. CThe visibility of all properties should be protected
    4. DAll method names in a controller must end in Action()
    5. EThe logic implemented in controllers should be kept to a minimum
  2. 2What are the characteristics of the methods redirect() and forward() in a controller? (2)
    1. AThe redirect() method requires the controller name of the target as an argument
    2. BThe redirect() method initiates a new HTTP request
    3. CThe forward() method transfers the request to the target action automatically
    4. DThe forward() method changes the URL in the way that the action name appears
    5. EThe redirect() and forward() methods both clear the cache
  3. 3What are the differences between the controller methods forward() and redirect()? (2)
    1. AThere are no differences
    2. BMethod $this->forward() is set as $this->request->setDispatched(false)
    3. CMethod $this->redirect() initiates a new HTTP request; method $this->forward() does not
    4. DMethod $this->forward() does not accept any arguments, $this->redirect() does
    5. EMethod $this->redirect() renders a template by default; method $this->forward() does not
  4. 4How can you generate a HTTP status code 400? (2)
    1. Adie(400, null, 'Bad Request.')
    2. B$this->addError(400, null, 'Bad Request.')
    3. Cnew \TYPO3\CMS\Extbase\Error\Error(400, null, 'Bad Request.')
    4. D$this->throwStatus(400, null, 'Bad Request.')
    5. EInstantiate a response object and set the status code as \GuzzleHttp\Psr7\Response(400)
  5. 5What are the characteristics of controllers? (2)
    1. AControllers are the control and central processing unit in the MVC stack
    2. BControllers are responsible for initialising domain models
    3. CThe logic implemented in controllers should be kept to a minimum
    4. DAll business logic should be implemented in controllers
    5. EControllers validate all objects
  6. 6Which statements about “actions” in Extbase’s controller/action concept are correct? (3)
    1. AAction methods are always static functions
    2. BActions are public methods of a controller class
    3. CNames of action methods always end in Action, for example listAction()
    4. DEach action must be stored in a separate PHP file under Classes/Actions/
    5. ETo be able to request an action of a plugin, the action has to be registered by using
      configurePlugin()
    6. FAction methods must always return a string (this is the content shown in the frontend)
  7. 7How can a fallback to the default action be achieved, in order to prevent an error if a non-configured action is
    called? (1)
    1. AThis is the default behaviour of Extbase
    2. BAn appropriate configuration in file ext_localconf.php is required
    3. CThe TypoScript setting callDefaultActionIfActionCantBeResolved can be configured
    4. DAn errorAction() method can be implemented in the controller
    5. EThe key routing can be used in TypoScript
  8. 8How can a “Page Not Found” error message be displayed – HTTP code 404 – if a non-configured action is called? (1)
    1. AThis is the default behaviour of Extbase
    2. BAn appropriate configuration in the ext_localconf.php file is required
    3. CThe TypoScript setting exceptionHandler can be configured
    4. DAn errorAction() method can be implemented in the controller
    5. EThe TypoScript setting throwPageNotFoundExceptionIfActionCantBeResolved can be configured
  9. 9Which approach is officially recommended to get an object in a controller? (1)
    1. Ause \Vendor\MyExtension\Domain\Repository\TagRepository;
      ...
      $this->objectManager->get(TagRepository::class)
    2. Buse \Vendor\MyExtension\Domain\Repository\TagRepository;
      ...
      $this->objectManager->create(TagRepository::class)
    3. Cnew \Vendor\MyExtension\Domain\Repository\TagRepository
    4. Duse \Vendor\MyExtension\Domain\Repository\TagRepository;
      ...
      $this->instanceManager->make(TagRepository::class)
    5. Euse \TYPO3\CMS\Core\Utility\GeneralUtility;
      use \Vendor\MyExtension\Domain\Repository\TagRepository;
      ...
      GeneralUtility::makeInstance(TagRepository::class);
  10. 10Where is the Object Manager available as $this->objectManager by default? (2)
    1. AIn repositories
    2. BIn ViewHelpers
    3. CIn Fluid templates
    4. DIn controllers
    5. EIn domain models

Informationen

Beschreibung
Der Nutzer hat seine Fachbereichs-Information gelöscht. Quiz am 4.2 Extbase Controllers and Actions, erstellt von Gelöschter Nutzer am 27/04/2022.
Autor
Gelöschter Nutzer
Sprache
English
Aufrufe
20
Verlauf
Erstellt am 27 Apr 2022 · aktualisiert am 27 Apr 2022
Bewertung
Noch keine Bewertungen
Bewerte dieses Quiz
Bewerte dieses Quiz

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck