Daily Archives: January 12, 2009

Application Super Heroes (PHP Application Super Arrays)

The super hero of the web application is the super array. An example of one from my CMS is detailed below.

$APP_CONFIG[$tbl_faqs]["id_name"] = “faq_id”;
$APP_CONFIG[$tbl_faqs]["question"] = array();
$APP_CONFIG[$tbl_faqs]["question"]["field_name"] = “question”;
$APP_CONFIG[$tbl_faqs]["question"]["field_title"] = “Question”;
$APP_CONFIG[$tbl_faqs]["question"]["field_type"] = “string”;
$APP_CONFIG[$tbl_faqs]["question"]["required"] = “Y”;
$APP_CONFIG[$tbl_faqs]["answer"] = array();
$APP_CONFIG[$tbl_faqs]["answer"]["field_name"] = “answer”;
$APP_CONFIG[$tbl_faqs]["answer"]["field_title"] = “Answer”;
$APP_CONFIG[$tbl_faqs]["answer"]["field_type"] = “string”;
$APP_CONFIG[$tbl_faqs]["answer"]["required"] = “Y”;
$APP_CONFIG[$tbl_faqs]["ordering"] = array();
$APP_CONFIG[$tbl_faqs]["ordering"]["field_name"] = “ordering”;
$APP_CONFIG[$tbl_faqs]["ordering"]["field_title"] = “Ordering”;
$APP_CONFIG[$tbl_faqs]["ordering"]["field_type"] = “int”;
$APP_CONFIG[$tbl_faqs]["ordering"]["required"] = “N”;
$APP_CONFIG[$tbl_faqs]["display"] = array();
$APP_CONFIG[$tbl_faqs]["display"]["field_name"] [...]