Skip to content

Instantly share code, notes, and snippets.

@skurfuerst
Created August 3, 2011 08:59
Show Gist options
  • Save skurfuerst/1122210 to your computer and use it in GitHub Desktop.
Save skurfuerst/1122210 to your computer and use it in GitHub Desktop.
<?php
public function harvest() {
// taken from AbstractTemplateView::render
$this->baseRenderingContext->setControllerContext($this->controllerContext);
$this->templateParser->setConfiguration($this->buildParserConfiguration());
$templateIdentifier = $this->getTemplateIdentifier(NULL);
if ($this->templateCompiler->has($templateIdentifier)) {
$parsedTemplate = $this->templateCompiler->get($templateIdentifier);
} else {
$parsedTemplate = $this->templateParser->parse($this->getTemplateSource($actionName));
if ($parsedTemplate->isCompilable()) {
$this->templateCompiler->store($templateIdentifier, $parsedTemplate);
}
}
// Now custom code
$this->startRendering(self::RENDERING_TEMPLATE, $parsedTemplate, $this->baseRenderingContext);
$this->renderSection('Configuration');
$vhVarContainer = $this->baseRenderingContext->getViewHelperVariableContainer();
// do stuff with vh var container now
$this->stopRendering();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment