ajax support

I've added the ajax option defaulted to `false`, so that the current behaviour is maintained.
I'm not sure the php view is fully functional, because I only use twig in all my projects, but the rest should work.