fix php 5.3.x compatibility for page and pagepart generator

Here is a PR to fix compatibility with sf 2.3 and 2.4 requirements
Opened to any suggestion :-)