Info.php 679 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 Info implements AnnotationInterface
  18. {
  19. /**
  20. * @var string
  21. */
  22. public $info = '';
  23. public function parseRule($rule)
  24. {
  25. $rule['info'] = $this->info;
  26. return $rule;
  27. }
  28. public function parseComponent($component)
  29. {
  30. $component->info($this->info);
  31. return $component;
  32. }
  33. }