/** * Execute the action */ public function execute() { parent::execute(); // get parameters $term = \SpoonFilter::getPostValue('term', null, ''); // validate if ($term == '') { $this->output(self::BAD_REQUEST, null, 'term-parameter is missing.'); } else { // get tags $tags = BackendTagsModel::getStartsWith($term); // output $this->output(self::OK, $tags); } }