Files
hocusfokus-web/kirby/src/Panel/Search.php
Bastian Allgeier 1c22148d7b Upgrade to 3.7.0
2022-06-27 11:59:19 +02:00

37 lines
776 B
PHP
Executable File

<?php
namespace Kirby\Panel;
/**
* The Search response class handles Fiber
* requests to render the JSON object for
* search queries
* @since 3.6.0
*
* @package Kirby Panel
* @author Bastian Allgeier <bastian@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier
* @license https://getkirby.com/license
*/
class Search extends Json
{
protected static $key = '$search';
/**
* @param mixed $data
* @param array $options
* @return \Kirby\Http\Response
*/
public static function response($data, array $options = [])
{
if (is_array($data) === true) {
$data = [
'results' => $data
];
}
return parent::response($data, $options);
}
}