Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
615 views
in Q2A Core by
Hi, This is a very nice application you have created, but I am not
able to understand the logic that you used for outputting the forms
html. Can you please throw some light on how to create a new form
within this app and the control flow of application.

1 Answer

0 votes
by
edited by
The basic flow is like this:

1. The appropriate qa-page-*.php file processes user input and builds a structure of nested arrays in $qa_content that includes a small amount of HTML that is not controlled by the theme (e.g. <INPUT> names).

2. The theme base class in qa-theme-base.php converts that structure into HTML, by adding a lot more markup. If you want to add extra forms, the most relevant control function in qa-theme-base.php is main().

So if you want to add an extra form, your best bet is probably to use $qa_content['form_2'], and base it on an example in one of the qa-page-*.php files. Probably, the login or register are good ones to start with. Just be aware that $qa_content['form_2'] is already used on a small number of pages, so you might have to use $qa_content['form_3'], and then change main() in qa-theme-base.php accordingly.
...