控制台应用,yzncms本身基于tp5.1框架,里面的队列用不了,bug,坑
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ModelField.php 1.2KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Yzncms [ 御宅男工作室 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2018 http://yzncms.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 御宅男 <530765310@qq.com>
  10. // +----------------------------------------------------------------------
  11. // +----------------------------------------------------------------------
  12. // | 字段模型
  13. // +----------------------------------------------------------------------
  14. namespace app\cms\model;
  15. use think\Model;
  16. /**
  17. * 字段模型
  18. */
  19. class ModelField extends Model
  20. {
  21. protected $autoWriteTimestamp = true;
  22. public function getExtendHtmlAttr($value, $data)
  23. {
  24. $result = preg_replace_callback("/\{([a-zA-Z]+)\}/", function ($matches) use ($data) {
  25. if (isset($data[$matches[1]])) {
  26. return $data[$matches[1]];
  27. }
  28. }, $data['extend']);
  29. return $result;
  30. }
  31. }