src/Forms/GridField/GridFieldFilterHeader.php
public function getSearchFormSchema(GridField $gridField)
    {
        $form = $this->getSearchForm($gridField);

        // If there are no filterable fields, return a 400 response
        if (!$form) {
            return new HTTPResponse(_t(__CLASS__ . '.SearchFormFaliure', 'No search form could be generated'), 400);
        }

        $parts = $gridField->getRequest()->getHeader(LeftAndMain::SCHEMA_HEADER);
        $schemaID = $gridField->getRequest()->getURL();
        $data = FormSchema::singleton()
            ->getMultipartSchema($parts, $schemaID, $form);

        $response = new HTTPResponse(json_encode($data));
        $response->addHeader('Content-Type', 'application/json');
        return $response;
    }
public function getSearchFormSchema(GridField $gridField)
    {
        $form = $this->getSearchForm($gridField);

        // If there are no filterable fields, return a 400 response
        if (!$form) {
            return new HTTPResponse(_t(__CLASS__ . '.SearchFormFaliure', 'No search form could be generated'), 400);
        }

        $parts = $gridField->getRequest()->getHeader(LeftAndMain::SCHEMA_HEADER);
        $schemaID = $gridField->getRequest()->getURL();
        $data = FormSchema::singleton()
            ->getMultipartSchema($parts, $schemaID, $form);

        $response = new HTTPResponse(json_encode($data));
        $response->addHeader('Content-Type', 'application/json');
        return $response;
    }
public function getSearchFormSchema ( GridField $ gridField ) { $ form = $ this -> getSearchForm ( $ gridField ) ; // If there are no filterable fields, return a 400 response if ( ! $ form ) { return new HTTPResponse ( _t ( __CLASS__ . '.SearchFormFaliure' , 'No search form could be generated' ) , 400 ) ; } $ parts = $ gridField -> getRequest ( ) -> getHeader ( LeftAndMain :: SCHEMA_HEADER ) ; $ schemaID = $ gridField -> getRequest ( ) -> getURL ( ) ; $ data = FormSchema :: singleton ( ) -> getMultipartSchema ( $ parts , $ schemaID , $ form ) ; $ response = new HTTPResponse ( json_encode ( $ data ) ) ; $ response -> addHeader ( 'Content-Type' , 'application/json' ) ; return $ response ; }
Returns the search form schema for the component

@param GridField $gridfield
@return HTTPResponse
Returns the search form schema for the component