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

Quiz

5.3 Alternative Views

Gelöschter Nutzer 3 Fragen Aktualisiert am 27 Apr 2022

Quiz starten

Fragen in diesem Quiz (3)

  1. 1How is the JSON view used? (1)
    1. AThe template filename must end in .json
    2. BThe third parameter of method assign() of the view must be true
    3. CThe initializeAction() in the controller requires the parameter $json = true
    4. DThe property $defaultViewObjectName can be used to create a JSON response by default
    5. EA directory View must exist inside Classes, which contains a file JsonView.php
  2. 2What is the output of the following code snippet that uses Extbase’s JSON view? (1)

    use \TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
    use \TYPO3\CMS\Extbase\Mvc\View\JsonView;
    class ExampleController extends ActionController
    {
    /**
    * @var \TYPO3\CMS\Extbase\Mvc\View\JsonView
    */
    protected $defaultViewObjectName = JsonView::class;
    public function showAction()
    {
    $data = ['foo' => 'bar'];
    $this->view->assign('value', $data);
    }
    }
    1. AThe JSON payload: {"value": ["foo": "bar"]}
    2. BThe JSON payload: {"foo": "bar"}
    3. CThe JSON payload: [foo = "bar"]
    4. DA serialized array: a:1:{s:3:"foo";s:3:"bar";}
    5. EAn empty serialized array: a:0:{}
  3. 3What is the purpose of the function call setVariablesToRender() of the JSON view in Extbase? (1)
    1. AThis is required to instruct the JSON view to render variable names other than value
    2. BThis is required to instruct the JSON view to render multidimensional arrays
    3. CThis is required to instruct the JSON view to render data types other than arrays
    4. DThis can be used to switch between JSON, HTML, XML, etc. formats on a case-by-case basis

Informationen

Beschreibung
Der Nutzer hat seine Fachbereichs-Information gelöscht. Quiz am 5.3 Alternative Views, erstellt von Gelöschter Nutzer am 27/04/2022.
Autor
Gelöschter Nutzer
Sprache
English
Aufrufe
28
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