本文整理汇总了PHP中FormBuilder::setTableName方法的典型用法代码示例。如果您正苦于以下问题:PHP FormBuilder::setTableName方法的具体用法?PHP FormBuilder::setTableName怎么用?PHP FormBuilder::setTableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormBuilder
的用法示例。
在下文中一共展示了FormBuilder::setTableName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$bDrop = $this->uri->segment(3);
$aTableNames = modelsToTableNames();
foreach ($aTableNames as $k => $sTableName) {
$oSqlBuilder = new SqlBuilder();
//** Build tables
$oTableName = new $k();
$sCreateSql = $oSqlBuilder->setTableName($sTableName)->getCreateTableString($oTableName->db);
$this->db->query('FLUSH TABLES;');
if ($bDrop) {
$this->db->query($oSqlBuilder->getDropTableString());
}
if (!tableExists($sTableName)) {
$this->db->query($sCreateSql);
}
//** Add in any default data
foreach ($oSqlBuilder->getDefaultDataArray($oTableName->data) as $v) {
//$oTableName->
$this->db->query($v);
}
}
foreach ($aTableNames as $k => $sTableName) {
$oTableName = new $k();
//** Make forms
if (!empty($oTableName->form)) {
$oFormBuilder = new FormBuilder();
$sForm = $oFormBuilder->setTableName($sTableName)->setFormName($sTableName)->setFormData($oTableName->form)->getFormString();
createFile('views/admin/includes/forms/' . $sTableName . '_form.php', $sForm);
}
}
}