Bootstrap.php 888 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * PHP表单生成器
  4. *
  5. * @package FormBuilder
  6. * @author xaboy <xaboy2005@qq.com>
  7. * @version 2.0
  8. * @license MIT
  9. * @link https://github.com/xaboy/form-builder
  10. * @document http://php.form-create.com
  11. */
  12. namespace FormBuilder\UI\Elm;
  13. use FormBuilder\Contract\BootstrapInterface;
  14. use FormBuilder\Form;
  15. class Bootstrap implements BootstrapInterface
  16. {
  17. public function init(Form $form)
  18. {
  19. $dependScript = $form->getDependScript();
  20. array_splice($dependScript, 2, 0, [
  21. '<link href="https://unpkg.com/element-ui@2.12.0/lib/theme-chalk/index.css" rel="stylesheet">',
  22. '<script src="https://unpkg.com/element-ui@2.12.0/lib/index.js"></script>',
  23. '<script src="https://unpkg.com/@form-create/element-ui@1.0.9/dist/form-create.min.js"></script>',
  24. ]);
  25. $form->setDependScript($dependScript);
  26. }
  27. }