Skip to content

Instantly share code, notes, and snippets.

@vojtech-dobes
Created October 19, 2011 10:36
Show Gist options
  • Save vojtech-dobes/1297934 to your computer and use it in GitHub Desktop.
Save vojtech-dobes/1297934 to your computer and use it in GitHub Desktop.
Fix for snippets rendered via Multiplier (unnecessary since 2.0.1 I guess)
<?php
// Nette/Latte/Macros/UIMacros - after line 507
$httpParams = $control->getPresenter()->getContext()->httpRequest->getQuery();
foreach ($control->getComponents(FALSE, 'Nette\Application\UI\Multiplier') as $multiplier) {
foreach ($httpParams as $param => $signal) {
if ($param == 'do' && Strings::startsWith($signal, $multiplier->getName()) && ($pos = strrpos($signal, '-')) !== FALSE) {
$child = $control->getComponent(substr($signal, 0, $pos));
$child->snippetMode = TRUE;
$child->render();
$child->snippetMode = FALSE;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment