Offer the possibility to override internal formatter objects from plugins

This commit is contained in:
Frederic Guillot
2016-12-20 20:06:39 -05:00
parent a957195952
commit ae708a712a
28 changed files with 200 additions and 72 deletions

View File

@@ -2,8 +2,6 @@
namespace Kanboard\Controller;
use Kanboard\Formatter\GroupAutoCompleteFormatter;
/**
* Group Ajax Controller
*
@@ -20,7 +18,7 @@ class GroupAjaxController extends BaseController
public function autocomplete()
{
$search = $this->request->getStringParam('term');
$formatter = new GroupAutoCompleteFormatter($this->groupManager->find($search));
$this->response->json($formatter->format());
$groups = $this->groupManager->find($search);
$this->response->json($this->groupAutoCompleteFormatter->withGroups($groups)->format());
}
}