Implementing Captcha Helper in Non-Standard Forms


Well-known member
I have an add-on that requires the captcha helper in a form for one of my add-ons. From what I read, it goes like this...

  1. PHP:
    is set as the 'captcha' param for the template that wants to implement it.
  2. Before the template is rendered,
    is called.
  3. PHP:
    XenForo_Captcha_Abstract::render(XenForo_View $view)
    is called using $this as $view (in XenForo_ViewPublic_Thread_Create::renderHtml).
The problem is that in my custom form, I am doing a simple template hook addition with $template->create. I have no XenForo_View to pass to the render method. What is the way to get or create an instance of XenForo_View in this case?