Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
AjaxView
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 initialize
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2declare(strict_types=1);
3
4/**
5 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
6 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
7 *
8 * Licensed under The MIT License
9 * For full copyright and license information, please see the LICENSE.txt
10 * Redistributions of files must retain the above copyright notice.
11 *
12 * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
13 * @link          https://cakephp.org CakePHP(tm) Project
14 * @since         3.0.4
15 * @license       https://opensource.org/licenses/mit-license.php MIT License
16 */
17namespace App\View;
18
19/**
20 * A view class that is used for AJAX responses.
21 * Currently only switches the default layout and sets the response type -
22 * which just maps to text/html by default.
23 */
24class AjaxView extends AppView
25{
26    /**
27     * The name of the layout file to render the view inside of. The name
28     * specified is the filename of the layout in /templates/Layout without
29     * the .php extension.
30     *
31     * @var string
32     */
33    protected string $layout = 'ajax';
34
35    /**
36     * Initialization hook method.
37     *
38     * @return void
39     */
40    public function initialize(): void
41    {
42        parent::initialize();
43
44        $this->response = $this->response->withType('ajax');
45    }
46}