Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
475 views
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)
                    $this->form($part);

to

elseif (strpos($key, 'form')===0) {
                    $this->form($part,$key);

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
by
 
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

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