1234567891011121314151617181920212223242526272829303132333435 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
- namespace app\cms\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;
- }
- }
|