Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Q2A Core by
edited by

This would allow us to modify some elements in particular forms by overidding the form() method and checking the name. I've done it for my site this way:

In function main_parts($content), I've simply changed this

elseif (strpos($key, 'form')===0)


elseif (strpos($key, 'form')===0) {

And added the key parameter to form($form) which became form($form,$formkey=null).

Since this method is called at some place, the null ensures compatibilty with other versions.

1 Answer

0 votes
Best answer

I can see the value of this, but the problem is that the key in most cases is just 'form', so a safer way to identify the form type might be to look at the template in $this->template

Template is in fact useful. A page where the form key is useful, is on the page_question since it contains many forms. Thanks!