Ported to Nette 2.2