本文整理汇总了PHP中HTTP::IsPost方法的典型用法代码示例。如果您正苦于以下问题:PHP HTTP::IsPost方法的具体用法?PHP HTTP::IsPost怎么用?PHP HTTP::IsPost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTP
的用法示例。
在下文中一共展示了HTTP::IsPost方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __Construct
function __Construct($user, $dictionary)
{
parent::__Construct(get_class());
$success = false;
$message = '';
$subscriptionId = null;
if (HTTP::IsPost()) {
$emailAddress = Params::Get('emailAddress');
$listReference = Params::Get('listReference');
$source = Params::Get('source', self::DEFAULT_SOURCE);
if (!Util::ValidateEmail($emailAddress)) {
$message = 'INVALID EMAIL ADDRESS';
} else {
//get list
$emailList = EmailList::FromReference(Application::PARTNER_CODE, $listReference);
if (is_null($emailList)) {
$message = "INVALID EMAIL LIST [" . $listReference . "]";
} else {
$success = $emailList->subscribe($source, $emailAddress, $user->getId(), $dictionary->getCode(), $message);
}
//send welcome email
if ($success) {
//load subscription back up for id
$subscription = Subscription::FromEmail($emailList->getId(), $emailAddress);
$subscriptionId = $subscription->getId();
//load template
if ($listReference == 'consumer') {
$templateRef = 'subscribe-consumer';
} else {
$templateRef = 'subscribe-provider';
}
//TODO: support multiple language emails (just need to deal with inheritance)
$template = EmsTemplate::FromReference(Application::PARTNER_CODE, $templateRef, 'EN');
//send email
Application::SendEmail($template->getFromEmailAddress(), $template->getFromName(), $template->getReplyToEmailAddress(), $emailAddress, $template->getSubject(), $template->getContent(), ContentType::HTML);
}
}
} else {
$message = "NO DATA POSTED";
}
//done
$this->jsonData = array('success' => $success, 'subscriptionId' => $subscriptionId, 'message' => $message);
}
示例2: __Construct
function __Construct($user, $dictionary)
{
parent::__Construct(get_class());
$success = false;
$message = '';
if (HTTP::IsPost()) {
//inputs
$subscriptionId = Params::GetLong('subscriptionId');
$name = Params::Get('name');
//load subscription
$subscription = new Subscription($subscriptionId);
$subscription->setName($name);
$subscription->save();
$success = true;
} else {
$message = "NO DATA POSTED";
}
//done
$this->jsonData = array('success' => $success, 'message' => $message);
}
示例3: __Construct
function __Construct($user, $dictionary)
{
parent::__Construct(get_class());
$success = false;
$message = '';
if (HTTP::IsPost()) {
$siteContact = new SiteContact();
$siteContact->setUserId($user->getId());
$siteContact->setTypeId(Params::GetLong('typeId'));
$siteContact->setContactName(Params::Get('contactName'));
$siteContact->setContactEmailAddress(Params::Get('contactEmailAddress'));
$siteContact->setContactPhone(Params::Get('contactPhone'));
$siteContact->setDictionaryCode($dictionary->getCode());
$siteContact->setContent(Params::Get('content'));
if ($siteContact->validate()) {
$siteContact->save();
$success = true;
//notify partner by email
$partner = new Partner(Application::PARTNER_CODE);
$recipientAddress = $partner->getConfigValue(PartnerConfig::COMMS_NOTIFY_EMAIL);
$content = "\n";
$content .= "A new site contact has been submitted on treatnow.co.\n\n";
$content .= '---------------------------------------------------------------------' . "\n";
$content .= "Type: " . $siteContact->getTypeName() . "\n";
$content .= "Contact Name: " . $siteContact->getContactName() . "\n";
$content .= "Contact Email: " . $siteContact->getContactEmailAddress() . "\n";
$content .= "Contact Phone: " . $siteContact->getContactPhone() . "\n";
$content .= '---------------------------------------------------------------------' . "\n\n";
$content .= $siteContact->getContent() . "\n";
$content .= '---------------------------------------------------------------------' . "\n\n";
$content .= "You can manage the contact here: http://manage.zidmi.com/operations/contacts/";
Application::SendEmail('notifications@zidmi.com', 'Zidmi', null, $recipientAddress, 'Site Contact', $content);
} else {
$message = $siteContact->getValidationError();
}
} else {
$message = "NO DATA POSTED";
}
//done
$this->jsonData = array('success' => $success, 'message' => $message);
}
示例4: __Construct
function __Construct($user, $dictionary)
{
parent::__Construct(get_class());
$success = false;
$message = '';
if (HTTP::IsPost()) {
$verificationCode = Params::Get('verificationCode');
$verifierName = Params::Get('verifierName');
if (!is_null($verificationCode) && !is_null($verifierName)) {
$provider = Provider::FromVerificationCode($verificationCode);
if (!is_null($provider)) {
$reference = 'UserId:' . $user->getId();
$provider->verify($verifierName, $reference);
$success = true;
}
}
} else {
$message = "NO DATA POSTED";
}
//done
$this->jsonData = array('success' => $success, 'message' => $message);
}
示例5: __Construct
function __Construct($user, $dictionary)
{
parent::__Construct(get_class());
$success = false;
$message = '';
if (HTTP::IsPost()) {
$verificationCode = Params::Get('verificationCode');
$verifierName = Params::Get('verifierName');
$feedback = Params::Get('feedback');
if (!is_null($verificationCode) && !is_null($verifierName) && !is_null($feedback)) {
$provider = Provider::FromVerificationCode($verificationCode);
if (!is_null($provider)) {
//add provider event
$reference = 'UserId:' . $user->getId();
$notes = "Submitted by:" . $verifierName . "\n" . $feedback;
$provider->addEvent(ProviderEventType::VERIFICATION_FEEDBACK, $reference, $notes);
$success = true;
//notify email
$partner = new Partner(Application::PARTNER_CODE);
$recipientAddress = $partner->getConfigValue(PartnerConfig::COMMS_NOTIFY_EMAIL);
$content = "\n";
$content .= "Some feedback has been submitted regarding provider data.\n\n";
$content .= '---------------------------------------------------------------------' . "\n";
$content .= "Provider: " . $provider->getName() . "\n";
$content .= "Submitted by: " . $verifierName . "\n";
$content .= "Feedback: \n";
$content .= $feedback . "\n";
$content .= '---------------------------------------------------------------------' . "\n\n";
Application::SendEmail('notifications@zidmi.com', 'Zidmi', null, $recipientAddress, 'Provider Verification Feedback', $content);
}
}
} else {
$message = "NO DATA POSTED";
}
//done
$this->jsonData = array('success' => $success, 'message' => $message);
}