Editable.php 634 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: NODELOG
  5. * Date: 16/7/22
  6. * Time: 下午12:08
  7. */
  8. namespace backend\widgets;
  9. class Editable extends \dosamigos\editable\Editable
  10. {
  11. public function init()
  12. {
  13. parent::init();
  14. if ($this->type == 'boolean') {
  15. $this->type = 'select';
  16. $source = [
  17. [
  18. 'value' => 0,
  19. 'text' => '否'
  20. ],
  21. [
  22. 'value' => 1,
  23. 'text' => '是'
  24. ]
  25. ];
  26. $this->clientOptions['source'] = $source;
  27. }
  28. }
  29. }