本文整理匯總了PHP中Generic::checkExists方法的典型用法代碼示例。如果您正苦於以下問題:PHP Generic::checkExists方法的具體用法?PHP Generic::checkExists怎麽用?PHP Generic::checkExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Generic
的用法示例。
在下文中一共展示了Generic::checkExists方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sprintf
function __construct()
{
// Only allow guests to view this page
parent::guestOnly();
/* Has the admin disabled user registrations? */
$disable = parent::getOption('disable-registrations-enable');
if ($disable) {
$this->error = sprintf('<div class="alert alert-block alert-error">%s</div>', _('<h4 class="alert-heading">Registrations disabled.</h4><p>Already have an account? <a href="login.php">Sign in here</a>!</p>'));
parent::displayMessage($this->error, true);
}
$this->use_emails = parent::getOption('email-as-username-enable');
$this->username_type = $this->use_emails ? 'email' : 'username';
// jQuery form validation
parent::checkExists();
// Generate a unique token for security purposes
parent::generateToken();
// Has the form been submitted?
if (!empty($_POST)) {
// Sign up form post data
foreach ($_POST as $field => $value) {
$this->settings[$field] = parent::secure($value);
}
$this->process();
}
if (isset($_GET['new_social'])) {
$this->error = sprintf('<div class="alert alert-success">%s</div>', _('We don\'t see you as a registered user. Perhaps you\'d like to sign up :)'));
}
parent::displayMessage($this->error, false);
}
示例2: substr
function __construct()
{
if (isset($_POST['searchUsers'])) {
$this->searchUsers();
exit;
}
// jQuery form validation
parent::checkExists();
if (isset($_POST['add_user'])) {
$this->name = parent::secure($_POST['name']);
$this->username = parent::secure($_POST['username']);
$this->email = parent::secure($_POST['email']);
$this->password = substr(md5(rand() . rand()), 0, 6);
// Confirm all details are correct
$this->verify();
// Create the user
$this->adduser();
if (!empty($this->error)) {
parent::displayMessage($this->error);
} else {
echo $this->result;
}
exit;
}
}
示例3:
function __construct()
{
// jQuery form validation
parent::checkExists();
if (isset($_POST['searchLevels'])) {
$this->searchLevels();
exit;
}
if (isset($_POST['add_level'])) {
$this->auth = parent::secure($_POST['auth']);
$this->level = parent::secure($_POST['level']);
// Confirm all details are correct
$this->verify();
// Create the level
$this->addlevel();
}
}