AjaxView.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  5. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  6. *
  7. * Licensed under The MIT License
  8. * For full copyright and license information, please see the LICENSE.txt
  9. * Redistributions of files must retain the above copyright notice.
  10. *
  11. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  12. * @link https://cakephp.org CakePHP(tm) Project
  13. * @since 3.0
  14. * @license https://opensource.org/licenses/mit-license.php MIT License
  15. */
  16. namespace Cake\View;
  17. /**
  18. * A view class that is used for AJAX responses.
  19. * Currently, only switches the default layout and sets the response type - which just maps to
  20. * text/html by default.
  21. */
  22. class AjaxView extends View
  23. {
  24. /**
  25. * @inheritDoc
  26. */
  27. protected $layout = 'ajax';
  28. /**
  29. * Get content type for this view.
  30. *
  31. * @return string
  32. */
  33. public static function contentType(): string
  34. {
  35. return 'text/html';
  36. }
  37. }