Fix generator templates

Fixes #132 

Adapted the php templates to the latest/current API.