Helper.php 1021 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Templating\Helper;
  11. /**
  12. * Helper is the base class for all helper classes.
  13. *
  14. * Most of the time, a Helper is an adapter around an existing
  15. * class that exposes a read-only interface for templates.
  16. *
  17. * @author Fabien Potencier <fabien@symfony.com>
  18. *
  19. * @api
  20. */
  21. abstract class Helper implements HelperInterface
  22. {
  23. protected $charset = 'UTF-8';
  24. /**
  25. * Sets the default charset.
  26. *
  27. * @param string $charset The charset
  28. *
  29. * @api
  30. */
  31. public function setCharset($charset)
  32. {
  33. $this->charset = $charset;
  34. }
  35. /**
  36. * Gets the default charset.
  37. *
  38. * @return string The default charset
  39. *
  40. * @api
  41. */
  42. public function getCharset()
  43. {
  44. return $this->charset;
  45. }
  46. }