DefaultTemplate.php 632 B

1234567891011121314151617181920212223
  1. <?php
  2. use Template\RenderableTemplate as RenderableTemplate;
  3. class DefaultTemplate extends RenderableTemplate {
  4. public function __construct() {
  5. }
  6. public function render() {
  7. $this->content = file_get_contents(__DIR__ . '/template.html');
  8. if(is_file($this->getView()['location'])){
  9. $this->content = str_replace('{{>content}}', $this->replaceSections(file_get_contents($this->getView()['location']), $this->_view['values']), $this->content);
  10. }else{
  11. $this->content = str_replace('{{>content}}', '', $this->content);
  12. }
  13. $this->implate();
  14. }
  15. }