4
0
Fork 0

更新 'src/Show/Field.php'

master
panliang 2022-09-23 15:58:39 +08:00
parent 361ff11542
commit 2ddbaff1b8
1 changed files with 10 additions and 0 deletions

View File

@ -56,6 +56,8 @@ class Field implements Renderable
*/ */
protected $escape = true; protected $escape = true;
protected $help;
/** /**
* Field value. * Field value.
* *
@ -702,6 +704,7 @@ HTML;
return [ return [
'content' => $this->value, 'content' => $this->value,
'escape' => $this->escape, 'escape' => $this->escape,
'help' => $this->help,
'label' => $this->getLabel(), 'label' => $this->getLabel(),
'wrapped' => $this->border, 'wrapped' => $this->border,
'width' => $this->width, 'width' => $this->width,
@ -772,4 +775,11 @@ HTML;
return format_byte($value, $dec); return format_byte($value, $dec);
}); });
} }
public function help($text = '', $icon = 'feather icon-help-circle')
{
$this->help = compact('text', 'icon');
return $this;
}
} }