qcubed/framework — pull request #512 by spekary (2014-10-21 04:17:33+00:00)
Title: feature-LocalControlTemplate

Currently, templates attached to block controls go through the QForm. The problem with this is that 'this' is not the control, but rather the form, and you can't call protected control methods, only form methods. This is counter-intuitive, since the template belongs to the control.

This fix leaves in place the $_FORM, $_CONTROL and $_ITEM variables, but $this is now the control, and you don't error when trying to call protected control methods. This is in preparation to changing the form templates so that the generated items live in a master control, rather than in the form itself.

This could potentially break current code, if the control template is relying on the form being $this. Its a simple fix to replace $this with $_FORM.