Created
February 25, 2016 21:54
-
-
Save muskie9/795a2b283700cd0df39c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class YourModelAdmin extends ModelAdmin{ | |
/** | |
* @return SearchContext | |
*/ | |
public function getSearchContext() | |
{ | |
$context = parent::getSearchContext(); | |
if ($this->modelClass == 'YourClass') { | |
$newField = DropdownField::create('q[FieldName]'); | |
$context->getFields()->replaceField('YourFieldToReplace', $newField); | |
} | |
return $context; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment