Output.php 710 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Tools;
  3. function _global_include_($filename, $vars)
  4. {
  5. extract($vars, EXTR_OVERWRITE);
  6. @include($filename);
  7. }
  8. class Output
  9. {
  10. private $context;
  11. private $output_filtering;
  12. public function __construct($context)
  13. {
  14. $this->output_filtering = true;
  15. $this->context = $context;
  16. }
  17. public function renderFile($filePath)
  18. {
  19. _global_include_($filePath, array(
  20. "controller" => $this->context->controller,
  21. "context" => $this->context,
  22. "cart" => $this->context->cart,
  23. "user" => $this->context->user));
  24. $content = ob_get_contents();
  25. ob_end_clean();
  26. $this->filter_content($content);
  27. }
  28. public function filter_content($content)
  29. {
  30. //TODO trigger hook
  31. echo $content;
  32. }
  33. }