ClassName.php 708 B

123456789101112131415161718192021222324252627282930313233343536373839
  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\Annotation;
  13. use FormBuilder\Contract\AnnotationInterface;
  14. /**
  15. * @Annotation
  16. */
  17. final class ClassName implements AnnotationInterface
  18. {
  19. /**
  20. * @var string
  21. */
  22. public $className = '';
  23. public function parseRule($rule)
  24. {
  25. $rule['className'] = $this->className;
  26. return $rule;
  27. }
  28. public function parseComponent($component)
  29. {
  30. $component->className($this->className);
  31. return $component;
  32. }
  33. }