require_once('configure.php');
require_once( TEMPLATE_CLASS );
//require_once( MAILER_CLASS );
$tpl = new Template();
$tpl->assign('action', MAIN_PAGE_ADDRESS);
if (!isset($_GET['action'])) {
$tpl->assign(array(
'add_message' => ADD_MESSAGE,
'add_label_choose' => ADD_LABEL_CHOOSE,
'add_multi' => ADD_MULTI,
'add_single' => ADD_SINGLE,
'add_submit_choose' => ADD_SUBMIT_CHOOSE,
'title' => ADD_TITLE
));
$tpl->display( DISPLAY_ADD . EXT_T );
} elseif($_GET['action'] == 'add') {
$tpl->assign('add_submit', ADD_SUBMIT);
$choose = $_GET['choose'];
$tpl->assign('hidden', $choose);
if ($choose == 'single') {
$tpl->assign(array(
'add_label_text' => ADD_LABEL_TEXT,
));
$tpl->display( DISPLAY_ADD . '_action-single' . EXT_T );
} elseif($choose == 'multi') {
$tpl->assign('add_label_textarea', ADD_LABEL_TEXTAREA);
$tpl->display( DISPLAY_ADD . '_action-multi' . EXT_T );
}
} elseif($_GET['action'] == 'try') {
//code to add some lines in file
} //end elseif
And I must replace conditional instruction but I don`t know how. I want replace conditional because I think that is not readable and any PHP Development deprecate it.


Sign In
Create Account


Back to top









