Frontend\Modules\Search\Ajax\Autosuggest::validateForm PHP Метод

validateForm() приватный Метод

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