Is this part of the documentation wrong? ... see screenshot attached. For me it seems, that at this point "$this->template" is still null. But within the context, when calling a registered function, then "$this->template" has the desired value. 