public function getSearchFieldSchema()
    {
        $schemaUrl = $this->Link('schema/SearchForm');

        $context = $this->getSearchContext();
        $params = $this->getRequest()->requestVar('q') ?: [];
        $context->setSearchParams($params);

        $placeholder = _t('SilverStripe\\CMS\\Search\\SearchForm.FILTERLABELTEXT', 'Search') . ' "' .
            SiteTree::singleton()->i18n_plural_name() . '"';

        $searchParams = $context->getSearchParams();

        $searchParams = array_combine(array_map(function ($key) {
            return 'Search__' . $key;
        }, array_keys($searchParams)), $searchParams);

        $schema = [
            'formSchemaUrl' => $schemaUrl,
            'name' => 'Term',
            'placeholder' => $placeholder,
            'filters' => $searchParams ?: new \stdClass // stdClass maps to empty json object '{}'
        ];

        return json_encode($schema);
    }
public function getSearchFieldSchema()
    {
        $schemaUrl = $this->Link('schema/SearchForm');

        $context = $this->getSearchContext();
        $params = $this->getRequest()->requestVar('q') ?: [];
        $context->setSearchParams($params);

        $placeholder = _t('SilverStripe\\CMS\\Search\\SearchForm.FILTERLABELTEXT', 'Search') . ' "' .
            SiteTree::singleton()->i18n_plural_name() . '"';

        $searchParams = $context->getSearchParams();

        $searchParams = array_combine(array_map(function ($key) {
            return 'Search__' . $key;
        }, array_keys($searchParams)), $searchParams);

        $schema = [
            'formSchemaUrl' => $schemaUrl,
            'name' => 'Term',
            'placeholder' => $placeholder,
            'filters' => $searchParams ?: new \stdClass // stdClass maps to empty json object '{}'
        ];

        return json_encode($schema);
    }
public function getSearchFieldSchema ( ) { $ schemaUrl = $ this -> Link ( 'schema/SearchForm' ) ; $ context = $ this -> getSearchContext ( ) ; $ params = $ this -> getRequest ( ) -> requestVar ( 'q' ) ? : [ ] ; $ context -> setSearchParams ( $ params ) ; $ placeholder = _t ( 'SilverStripe\\CMS\\Search\\SearchForm.FILTERLABELTEXT' , 'Search' ) . ' "' . SiteTree :: singleton ( ) -> i18n_plural_name ( ) . '"' ; $ searchParams = $ context -> getSearchParams ( ) ; $ searchParams = array_combine ( array_map ( function ( $ key ) { return 'Search__' . $ key ; } , array_keys ( $ searchParams ) ) , $ searchParams ) ; $ schema = [ 'formSchemaUrl' => $ schemaUrl , 'name' => 'Term' , 'placeholder' => $ placeholder , 'filters' => $ searchParams ? : new \ stdClass // stdClass maps to empty json object '{}' ] ; return json_encode ( $ schema ) ; }
Returns the search form schema for the current model

@return string
Returns the search form schema for the current model