Skip to content

Instantly share code, notes, and snippets.

@matej21
Created February 14, 2018 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matej21/a82b77eae51f06ce02eab882bf1a8b04 to your computer and use it in GitHub Desktop.
Save matej21/a82b77eae51f06ce02eab882bf1a8b04 to your computer and use it in GitHub Desktop.
<?php
protected function resetPersistentParameters($args)
{
$rc = new Nette\Application\UI\PresenterComponentReflection($this);
$propertyValues = $rc->getDefaultProperties();
foreach ($rc->getPersistentParams() as $param => $def) {
if (!array_key_exists($param, $args) && array_key_exists($param, $propertyValues)) {
$args[$param] = $propertyValues[$param];
}
}
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment