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)); }
public function testFieldWithAllIndex() { $autocomplete = new Kirby\Panel\Autocomplete($this->panel, 'field', array('uri' => 'projects', 'index' => 'all', 'field' => 'title')); $expected = array('Project A', 'Project B', 'Project C', 'Projects'); $this->assertEquals($autocomplete->result(), $expected); }