Implementing Captcha Helper in Non-Standard Forms

vbresults

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:
    XenForo_Captcha_Abstract::createDefault()
    is set as the 'captcha' param for the template that wants to implement it.
  2. Before the template is rendered,
    PHP:
    XenForo_ViewPublic_Thread_Create::renderHtml()
    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?
 
Top Bottom