本文整理汇总了PHP中DatabaseManager::settingsValueForKey方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseManager::settingsValueForKey方法的具体用法?PHP DatabaseManager::settingsValueForKey怎么用?PHP DatabaseManager::settingsValueForKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseManager
的用法示例。
在下文中一共展示了DatabaseManager::settingsValueForKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DatabaseManager
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/database.class.php";
$manager = new DatabaseManager();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// They have submitted changes to the keychain
foreach ($_POST as $key => $value) {
if (!empty($key) && !empty($value)) {
$manager->settingsSetValueForKey($key, $value);
}
}
echo "Changes Saved!";
}
// They are requesting to see the editor webpage
$foursquareToken = $manager->settingsValueForKey("foursquare_token");
$instagramId = $manager->settingsValueForKey("instagram_id");
$instagramSecret = $manager->settingsValueForKey("instagram_secret");
$instagramUrl = $manager->settingsValueForKey("instagram_url");
$instagramUri = $manager->settingsValueForKey("instagram_uri");
$password = $manager->settingsValueForKey("password");
$printing = $manager->settingsValueForKey("printing");
$checked = $printing == 1 ? "checked='checked'" : "";
echo "<input name='foursquare_token' type='text' placeholder='Foursquare Token' value='{$foursquareToken}'>";
echo "<input name='instagram_id' type='text' placeholder='Instagram Client Id' value='{$instagramId}'>";
echo "<input name='instagram_secret' type='text' placeholder='Instagram Client Secret' value='{$instagramSecret}'>";
echo "<input name='instagram_url' type='text' placeholder='Instagram Callback Url' value='{$instagramUrl}'>";
echo "<input name='instagram_uri' type='text' placeholder='Instagram Oauth Callback' value='{$instagramUri}'>";
echo "<input name='password' type='text' placeholder='Password' value='{$password}'>";
echo "<input name='printing' type='checkbox' {$checked}>";
?>
示例2: getInstagramRedirectUri
public function getInstagramRedirectUri()
{
$manager = new DatabaseManager();
$credentials = $this->getInstagramCredentials();
return $manager->settingsValueForKey("instagram_uri");
}