sterzycom/panel/app/controllers/autocomplete.php

20 lines
No EOL
359 B
PHP

<?php
class AutocompleteController extends Kirby\Panel\Controllers\Base {
public function index($method) {
try {
$auto = new Kirby\Panel\Autocomplete(panel(), $method, get());
$result = $auto->result();
} catch(Exception $e) {
$result = array();
}
return $this->json(array(
'data' => $result
));
}
}