summaryrefslogtreecommitdiff
path: root/app/Controller/GroupHelper.php
blob: 06e5ec711a7566692cb2e2b7deb9c2fb4e83ab6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

namespace Kanboard\Controller;

use Kanboard\Formatter\GroupAutoCompleteFormatter;

/**
 * Group Helper
 *
 * @package  controller
 * @author   Frederic Guillot
 */
class GroupHelper extends BaseController
{
    /**
     * Group auto-completion (Ajax)
     *
     * @access public
     */
    public function autocomplete()
    {
        $search = $this->request->getStringParam('term');
        $formatter = new GroupAutoCompleteFormatter($this->groupManager->find($search));
        $this->response->json($formatter->format());
    }
}