// +---------------------------------------------------------------------- // +---------------------------------------------------------------------- // | 字段模型 // +---------------------------------------------------------------------- namespace addons\formguide\model; use think\Model; /** * 字段模型 */ class ModelField extends Model { protected $autoWriteTimestamp = true; public function getExtendHtmlAttr($value, $data) { $result = preg_replace_callback("/\{([a-zA-Z]+)\}/", function ($matches) use ($data) { if (isset($data[$matches[1]])) { return $data[$matches[1]]; } }, $data['extend']); return $result; } }