Skip to content

Commit

Permalink
filter search
Browse files Browse the repository at this point in the history
  • Loading branch information
alikon committed Dec 14, 2023
1 parent 4172762 commit c8da438
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions api/components/com_tags/src/Controller/TagsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Joomla\Component\Tags\Api\Controller;

use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\MVC\Controller\ApiController;

// phpcs:disable PSR1.Files.SideEffects
Expand Down Expand Up @@ -38,4 +39,23 @@ class TagsController extends ApiController
* @since 3.0
*/
protected $default_view = 'tags';

/**
* Basic display of a list view
*
* @return static A \JControllerLegacy object to support chaining.
*
* @since __DEPLOY_VERSION__
*/
public function displayList()
{
$apiFilterInfo = $this->input->get('filter', [], 'array');
$filter = InputFilter::getInstance();

if (\array_key_exists('search', $apiFilterInfo)) {
$this->modelState->set('filter.search', $filter->clean($apiFilterInfo['search'], 'STRING'));
}

return parent::displayList();
}
}

0 comments on commit c8da438

Please sign in to comment.