gtText.php 426 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * Get a text message
  4. *
  5. */
  6. class gtText
  7. {
  8. /**
  9. * Get the text message and return it
  10. *
  11. * @param string $name
  12. * @return string
  13. */
  14. public static function get($name) {
  15. $filename = dirname(__FILE__) . '/texts/' . $name . '.txt';
  16. if (!file_exists($filename)) {
  17. throw new LogicException('The text ' . $name . ' does not exist');
  18. }
  19. return file_get_contents($filename);
  20. }
  21. }
  22. ?>