SimpleHelper.php 482 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. use Symfony\Component\Templating\Helper\Helper;
  3. class SimpleHelper extends Helper
  4. {
  5. protected $value = '';
  6. public function __construct($value)
  7. {
  8. $this->value = $value;
  9. }
  10. public function __toString()
  11. {
  12. return $this->value;
  13. }
  14. public function getName()
  15. {
  16. return 'foo';
  17. }
  18. public function getGlobals()
  19. {
  20. return array(
  21. 'global_from_helper' => 'helper lorem ipsum',
  22. );
  23. }
  24. }