emulate twig path functionality