Added getConfig helper method to get config values (#4653)
Credit to @SaifurRahmanMohsin Added getConfig to make it easier for developers to fetch the config data from a list column while overriding the list items through extension. This also makes the class more compatible with [FormField](https://github.com/octobercms/october/blob/master/modules/backend/classes/FormField.php) which already has the same helper function.
This commit is contained in:
parent
8ee94cc059
commit
f6c789f716
|
|
@ -219,6 +219,17 @@ class ListColumn
|
||||||
return $this->align ? 'list-cell-align-' . $this->align : '';
|
return $this->align ? 'list-cell-align-' . $this->align : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a raw config item value.
|
||||||
|
* @param string $value
|
||||||
|
* @param string $default
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function getConfig($value, $default = null)
|
||||||
|
{
|
||||||
|
return array_get($this->config, $value, $default);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns this columns value from a supplied data set, which can be
|
* Returns this columns value from a supplied data set, which can be
|
||||||
* an array or a model or another generic collection.
|
* an array or a model or another generic collection.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue