Frontend\Modules\Search\Ajax\Livesuggest::validateForm PHP Méthode

validateForm() private méthode

Validate the form
private validateForm ( )
    private function validateForm()
    {
        // set search term
        $charset = $this->getContainer()->getParameter('kernel.charset');
        $searchTerm = \SpoonFilter::getPostValue('term', null, '');
        $this->term = $charset == 'utf-8' ? \SpoonFilter::htmlspecialchars($searchTerm) : \SpoonFilter::htmlentities($searchTerm);
        // validate
        if ($this->term == '') {
            $this->output(self::BAD_REQUEST, null, 'term-parameter is missing.');
        }
    }