function morphologyHook(\Formal\Form $oForm, \Formal\Form\Morphology $oMorpho) { if ($oForm->submitted()) { $bMySQL = intval($oForm->postValue("PROJECT_DB_MYSQL")) === 1; } else { $bMySQL = PROJECT_DB_MYSQL; } if ($bMySQL === true) { $oMorpho->remove("PROJECT_SQLITE_FILE"); } else { $oMorpho->remove("PROJECT_DB_MYSQL_HOST"); $oMorpho->remove("PROJECT_DB_MYSQL_DBNAME"); $oMorpho->remove("PROJECT_DB_MYSQL_USERNAME"); $oMorpho->remove("PROJECT_DB_MYSQL_PASSWORD"); } }
public function hideMySQLFieldWhenNeeded(\Formal\Form $oForm, \Formal\Form\Morphology $oMorpho) { if ($oForm->submitted()) { $bMySQL = intval($oForm->postValue("PROJECT_DB_MYSQL")) === 1; } else { $bMySQL = PROJECT_DB_MYSQL; } if ($bMySQL === TRUE) { $oMorpho->remove("PROJECT_SQLITE_FILE"); } else { $oMorpho->remove("PROJECT_DB_MYSQL_HOST"); $oMorpho->remove("PROJECT_DB_MYSQL_DBNAME"); $oMorpho->remove("PROJECT_DB_MYSQL_USERNAME"); $oMorpho->remove("PROJECT_DB_MYSQL_PASSWORD"); } }