本文整理汇总了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);
}
}