src/Fields/TileField.php
/**
     * handles a delete request via ajax
     * @param HTTPRequest $request
     * @return HTTP
     * @throws \SilverStripe\Control\HTTPResponse_Exception
     */
handles a delete request via ajax
@param HTTPRequest $request
@return HTTP
@throws \SilverStripe\Control\HTTPResponse_Exception
handles a delete request via ajax @param HTTPRequest $request @return HTTP @throws \ SilverStripe \ Control \ HTTPResponse_Exception
public function delete(HTTPRequest $request)
    {
        $tileid = $request->latestParam('Action');
        $mytile = Tile::get()->byID($tileid);
        if ($mytile) {
            $mytile->delete();
            return \SilverStripe\Control\HTTPResponse::create('Tile with ID ' . $tileid . ' has been deleted');
        }
        throw new \SilverStripe\Control\HTTPResponse_Exception('failed to find Tile', 400);
    }
public function delete ( HTTPRequest $ request ) { $ tileid = $ request -> latestParam ( 'Action' ) ; $ mytile = Tile :: get ( ) -> byID ( $ tileid ) ; if ( $ mytile ) { $ mytile -> delete ( ) ; return \ SilverStripe \ Control \ HTTPResponse :: create ( 'Tile with ID ' . $ tileid . ' has been deleted' ) ; } throw new \ SilverStripe \ Control \ HTTPResponse_Exception ( 'failed to find Tile' , 400 ) ; }
handles a delete request via ajax
 @param HTTPRequest $request
 @return HTTP
 @throws \SilverStripe\Control\HTTPResponse_Exception
handles a delete request via ajax @param HTTPRequest $request @return HTTP @throws \ SilverStripe \ Control \ HTTPResponse_Exception