Instant Forms with Application Super Arrays

If you have built an application using a super array, it is exceedinly simple to add new forms into an application. Into my main cms.php file located in admin, I have a section of the file which reads:

$module_dir = "faqs";
$item = "FAQ";
$item_plural = "FAQs";
$id_name = "faq_id";
$this_tbl = $tbl_faqs;

$order_by = $APP_CONFIG[$this_tbl]["question"]["field_name"];
$table_headers = array("Question","Ordering","Display","Edit","Delete");
$field_names = array(
			$APP_CONFIG[$this_tbl]["question"]["field_name"],
			$APP_CONFIG[$this_tbl]["ordering"]["field_name"],
			$APP_CONFIG[$this_tbl]["display"]["field_name"]
			);
break;

Then, contained in an includes file, I have a generic file named add_base.php which contains the following code snippet:

$text = "Enter the question.";
echo formTextBox($APP_CONFIG[$this_tbl]["question"], 30, $question, $text);
$text = "Enter the answer.";
echo formTextarea($APP_CONFIG[$this_tbl]["answer"], 40, 5, $answer, $text);

The above section calls my form library functions and outputs the form.

Next week: My form library

Post a Comment

Your email is never shared. Required fields are marked *

*
*