Add PHP methods when generating a page type