本文整理匯總了PHP中DataManager::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataManager::save方法的具體用法?PHP DataManager::save怎麽用?PHP DataManager::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DataManager
的用法示例。
在下文中一共展示了DataManager::save方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: save
function save()
{
$data = $this->input->post();
$dm = new DataManager($this->dm_profile);
if ($dm->save($data) === false) {
var_dump($dm->getErrors());
exit;
}
redirect('/' . $this->controller);
}
示例2: catch
} catch (dbx\Exception $ex) {
error_log("/dropbox-auth-finish: error communicating with Dropbox API: " . $ex->getMessage());
respondWithError(500, "Internal Server Error");
exit;
}
// NOTE: A real web app would store the access token in a database.
$_SESSION['access-token'] = $accessToken;
$_user = new DataManager('User');
$_user->setField('userName', 'HackTheVisual');
$_user->setField('session', $accessToken);
$_user->save();
$_folder = new DataManager('Picture');
$_folder->setField('idUser', 1);
$_folder->setField('path', '/Pictures');
$_folder->setField('isFolder', true);
$_folder->save();
header('Location: ' . getPath(""));
echo renderHtmlPage("Authorized!", "Auth complete, <a href='" . htmlspecialchars(getPath("")) . "'>click here</a> to browse.");
} else {
if ($requestPath === "/dropbox-auth-unlink") {
// "Forget" the access token.
unset($_SESSION['access-token']);
echo renderHtmlPage("Unlinked.", "Go back <a href='" . htmlspecialchars(getPath("")) . "'>home</a>.");
} else {
echo renderHtmlPage("Bad URL", "No handler for {$requestPath}");
exit;
}
}
}
}
}