__('Rich_text'), 'text' => __('Text')]; } public function getTextShortAttr($value, $data) { if (!empty($data['text'])) { $text = mb_substr(strip_tags($data['text']), 0, 50); return mb_strlen($text) >= 50 ? $text . '...' : $text; } return ''; } public function getUpdateTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['update_time']) ? $data['update_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setUpdateTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } }