¡GoConqr estrena diseño! Cuéntanos qué te parece.

Test

5.3 Alternative Views

Usuario eliminado 3 preguntas Actualizado el 27 abr 2022

Hacer el test

Preguntas del test (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

Información

Descripción
El usuario ha eliminado su información de asignaturas Test sobre 5.3 Alternative Views, creado por Usuario eliminado el 27/04/2022.
Autor
Usuario eliminado
Idioma
English
Visitas
28
Historial
Creado el 27 abr 2022 · actualizado el 27 abr 2022
Valoración
Aún sin valoraciones
Valora este test
Valora este test

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?