That tutorial you mention is very old and contains example api calls which are long ago deprecated.
What version of eZ Publish are you using? In eZ Publish 4.3 templateInit() has been deprecated, so in the future calls to to get template instance should use this replacement instead: