Skip to content
This repository has been archived by the owner on Jan 14, 2018. It is now read-only.

adding support for prepending and appending files #5

Merged
merged 1 commit into from Nov 14, 2014

Conversation

justb3a
Copy link

@justb3a justb3a commented Nov 12, 2014

I wanted to use

$config->prependTemplateFile = '_init.php';
$config->appendTemplateFile = '_done.php';

functionality but it does not work. This fix works for me but maybe there is a better way to solve it.

I added some code in function renderPageWithTwig

$defaultOptions = array(
+  'prependFile' => $page->template->noPrependTemplateFile ? null : $config->prependTemplateFile,
+  'prependFiles' => $page->template->prependFile ? array($page->template->prependFile) : array(),
+  'appendFile' => $page->template->noAppendTemplateFile ? null : $config->appendTemplateFile,
+  'appendFiles' => $page->template->appendFile ? array($page->template->appendFile) : array(),
    'forceBuildCache' => false,
);
+  $files = $this->getPrependAppendFiles($page, $options, $config);
+  $output = $this->combineOutput($files, $page);

Please have a look at getPrependAppendFiles and combineOutput at the end.

@felixwahner felixwahner merged commit 2ab529c into marcostoll:master Nov 14, 2014
@justb3a justb3a deleted the feature/prepend-append-files branch November 18, 2014 21:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants