Mobile.php 559 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Dcat\Admin\Form\Field;
  3. class Mobile extends Text
  4. {
  5. public static $js = 'jquery.inputmask';
  6. public static $css = 'jquery.inputmask';
  7. /**
  8. * @see https://github.com/RobinHerbots/Inputmask#options
  9. *
  10. * @var array
  11. */
  12. protected $options = [
  13. 'mask' => '99999999999',
  14. ];
  15. public function render()
  16. {
  17. $this->inputmask($this->options);
  18. $this->prepend('<i class="ti-mobile"></i>')
  19. ->defaultAttribute('style', 'width: 200px');
  20. return parent::render();
  21. }
  22. }