GoConqr has a new look! Let us know what you think.

Quiz

5.3 Alternative Views

Deleted user 3 questions Updated 27 Apr 2022

Take the quiz

Questions in this 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

Information

Description
User has deleted their subject information Quiz on 5.3 Alternative Views, created by Deleted user on 27/04/2022.
Author
Deleted user
Language
English
Views
28
History
Created on 27 Apr 2022 · updated on 27 Apr 2022
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?