PriceDescription.php 995 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. *
  4. * PHP Pro Bid $Id$ jTVNuEljSqXTnR4CnO+A9cg7F3SN520/uY7EOtZRC+E=
  5. *
  6. * @link http://www.phpprobid.com
  7. * @copyright Copyright (c) 2014 Online Ventures Software LTD & CodeCube SRL
  8. * @license http://www.phpprobid.com/license Commercial License
  9. *
  10. * @version 7.0
  11. */
  12. /**
  13. * display price pseudo form element
  14. */
  15. namespace Ppb\Form\Element;
  16. use Cube\Form\Element\Hidden,
  17. Cube\Controller\Front;
  18. class PriceDescription extends Hidden
  19. {
  20. /**
  21. *
  22. * class constructor
  23. *
  24. * @param string $name
  25. */
  26. public function __construct($name)
  27. {
  28. parent::__construct($name);
  29. $this->setHidden(false);
  30. }
  31. /**
  32. *
  33. * render pseudo element
  34. *
  35. * @return string
  36. */
  37. public function render()
  38. {
  39. $currency = $this->getPrefix();
  40. $view = Front::getInstance()->getBootstrap()->getResource('view');
  41. return $view->amount($this->getValue(), $currency) . parent::render();
  42. }
  43. }