Guest User

Untitled

a guest
Jun 22nd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2. require_once(JELIX_LIB_PATH.'tpl/jTpl.class.php');
  3.  
  4. class myLatexResponse extends jResponse {
  5.  
  6. protected $_type = 'latex';
  7.  
  8. public $content = null;
  9.  
  10. public $contentTpl = '';
  11.  
  12. function __construct() {
  13. $this->content = new jTpl();
  14. parent::__construct();
  15. }
  16.  
  17. final public function output(){
  18.  
  19. if(!empty($this->contentTpl)) {
  20. $this->contentTpl->assign(...);
  21. ...
  22. $latexStr = $this->content->fetch($this->contentTpl);
  23. }
  24.  
  25. $this->_httpHeaders['Content-Type']='application/x-latex';
  26. $this->_httpHeaders['Content-length']=@filesize($texFile);
  27. $this->sendHttpHeaders();
  28.  
  29. echo $latexStr;
  30.  
  31. return true;
  32. }
  33.  
  34.  
  35. }
Add Comment
Please, Sign In to add comment