Description.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. *
  4. * Cube Framework $Id$ DSdRF536oEBbuXJGDNv63b3qJoC8CfsC1XekseTBn9s=
  5. *
  6. * @link http://codecu.be/framework
  7. * @copyright Copyright (c) 2014 CodeCube SRL
  8. * @license http://codecu.be/framework/license Commercial License
  9. *
  10. * @version 1.0
  11. */
  12. /**
  13. * not actually a form element, instead it will be a simple text description
  14. */
  15. namespace Cube\Form\Element;
  16. use Cube\Form\Element;
  17. class Description extends Element
  18. {
  19. /**
  20. *
  21. * type of element - override the variable from the parent class
  22. *
  23. * @var string
  24. */
  25. protected $_element = 'description';
  26. /**
  27. *
  28. * class constructor
  29. *
  30. * @param string $name
  31. */
  32. public function __construct($name)
  33. {
  34. parent::__construct($this->_element, $name);
  35. }
  36. /**
  37. *
  38. * render the form element
  39. *
  40. * @return string
  41. */
  42. public function render()
  43. {
  44. return $this->getPrefix() . ' '
  45. . $this->getValue() . ' '
  46. . $this->getSuffix();
  47. }
  48. }