本文整理匯總了PHP中model::GetInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP model::GetInstance方法的具體用法?PHP model::GetInstance怎麽用?PHP model::GetInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類model
的用法示例。
在下文中一共展示了model::GetInstance方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: action_open
public function action_open()
{
$pageName = $this->params[2];
$model = model::GetInstance();
$params = $model->get_all($pageName);
$this->content = $this->template("view/{$pageName}.php", ["params" => $params]);
}
示例2: action_delete
public function action_delete()
{
$idName = $this->params[3];
$id = $this->params[4];
$pageName = $this->params[2];
if ($id != NULL) {
$model = model::GetInstance();
$model->delete($pageName, $idName, $id);
$this->action_open($pageName);
}
}
示例3: print_r
}
if ($count == 'many') {
if (isset($table) && isset($id_name) && isset($id)) {
$model = model_some::GetInstance();
$data = $model->select_some($table, $id_name, $id);
print_r(json_encode($data));
exit;
}
}
}
if (isset($action) && $action == 'add') {
if (isset($table) && isset($params)) {
$model = model::GetInstance();
$idNew = $model->add($table, $params);
print_r($idNew);
}
}
if (isset($action) && $action == 'edit') {
if (isset($table) && isset($id_name) && isset($id) && isset($params)) {
$model = model::GetInstance();
$rows = $model->edit($table, $id_name, $id, $params);
print_r($rows);
}
}
if (isset($action) && $action == 'delete') {
if (isset($table) && isset($id_name) && isset($id)) {
$model = model::GetInstance();
$rows = $model->delete($table, $id_name, $id);
print_r($rows);
}
}