Enabled defaults to ORM::display(), if values dont have a value
This commit is contained in:
parent
fdd06daed3
commit
01a370dcf2
@ -190,10 +190,13 @@ abstract class lnApp_ORM extends Kohana_ORM {
|
|||||||
/**
|
/**
|
||||||
* Return a formated columns, as per the model definition
|
* Return a formated columns, as per the model definition
|
||||||
*/
|
*/
|
||||||
public function display($column) {
|
public function display($column,$default='') {
|
||||||
// Trigger a load of the record.
|
// Trigger a load of the record.
|
||||||
$value = $this->__get($column);
|
$value = $this->__get($column);
|
||||||
|
|
||||||
|
if (! $value)
|
||||||
|
$value = $default;
|
||||||
|
|
||||||
// If some of our fields need to be formated for display purposes.
|
// If some of our fields need to be formated for display purposes.
|
||||||
if (! $this->_formated AND $this->_display_filters)
|
if (! $this->_formated AND $this->_display_filters)
|
||||||
$this->_format();
|
$this->_format();
|
||||||
|
@ -21,7 +21,7 @@ abstract class lnApp_Site {
|
|||||||
* Show a date using a site configured format
|
* Show a date using a site configured format
|
||||||
*/
|
*/
|
||||||
public static function Date($date) {
|
public static function Date($date) {
|
||||||
return (is_null($date) OR ! $date) ? '' : date(Kohana::$config->load('config')->date_format,$date);
|
return (is_null($date) OR ! is_numeric($date)) ? $date : date(Kohana::$config->load('config')->date_format,$date);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user