本文整理汇总了PHP中KT::getRequestUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP KT::getRequestUrl方法的具体用法?PHP KT::getRequestUrl怎么用?PHP KT::getRequestUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KT
的用法示例。
在下文中一共展示了KT::getRequestUrl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processMail
/**
* Zpracování údajů z POSTu (bez spam validace) a případné zodeslání mailu
*
* @author Martin Hlaváč
* @link http://www.ktstudio.cz
*
* @param array $values
* @return boolean
*/
protected function processMail(array $values)
{
if (count($values) > 0) {
$firstName = htmlspecialchars(KT::arrayTryGetValue($values, KT_Contact_Form_Base_Config::FIRST_NAME));
$lastName = htmlspecialchars(KT::arrayTryGetValue($values, KT_Contact_Form_Base_Config::LAST_NAME));
$name = htmlspecialchars(KT::arrayTryGetValue($values, KT_Contact_Form_Base_Config::NAME));
$email = htmlspecialchars(KT::arrayTryGetValue($values, KT_Contact_Form_Base_Config::EMAIL));
$phone = htmlspecialchars(KT::arrayTryGetValue($values, KT_Contact_Form_Base_Config::PHONE));
$message = htmlspecialchars(KT::arrayTryGetValue($values, KT_Contact_Form_Base_Config::MESSAGE));
$fullName = $name ?: "{$firstName} {$lastName}";
if (KT::issetAndNotEmpty($fullName) && KT::issetAndNotEmpty($email) && KT::issetAndNotEmpty($phone) && KT::issetAndNotEmpty($message) && is_email($email)) {
$ktWpInfo = new KT_WP_Info();
$requestUrl = KT::getRequestUrl();
$requestLink = "<a href=\"{$requestUrl}\">{$requestUrl}</a>";
$content = sprintf(__("Jméno: %s", "KT_CORE_DOMAIN"), $fullName) . "<br>";
$content .= sprintf(__("E-mail: %s", "KT_CORE_DOMAIN"), $email) . "<br>";
$content .= sprintf(__("Telefon: %s", "KT_CORE_DOMAIN"), $phone) . "<br><br>";
$content .= __("Zpráva:", "KT_CORE_DOMAIN") . "<br><br>{$message}<br><br>";
$content .= sprintf(__("Provedeno z URL adresy: %s", "KT_CORE_DOMAIN"), $requestLink) . "<br><br>---<br>";
$content .= sprintf($this->getEmailSignature(), $ktWpInfo->getUrl());
$contactFormEmail = apply_filters("kt_contact_form_email_filter", $this->getFormEmail());
$mailer = new KT_Mailer($contactFormEmail, $ktWpInfo->getName(), sprintf($this->getEmailTitle(), $ktWpInfo->getName()));
$mailer->setReplyToEmail($email);
$mailer->setContent($content);
return $sendResult = $mailer->send();
}
}
return false;
}
示例2: initPermalink
/** @return string */
protected function initPermalink()
{
return $this->permalink = KT::getRequestUrl();
}
示例3: process
/**
* Kontrola a zpracování (odeslaných) dat (z POSTu), pokud je to možné
*
* @author Martin Hlaváč
* @link http://www.ktstudio.cz
*/
public function process()
{
if (KT::arrayIssetAndNotEmpty($_POST)) {
$form = $this->getForm();
if (!$form->nonceValidate()) {
wp_die(__("Chyba zpracování zdrojové adresy...", KT_DOMAIN));
exit;
}
$form->validate();
if (!$form->hasError()) {
$values = filter_input(INPUT_POST, KT_Contact_Form_Base_Config::FORM_PREFIX, FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
if (KT::arrayIssetAndNotEmpty($values)) {
$spam = KT::arrayTryGetValue($values, KT_Contact_Form_Base_Config::FAVOURITE);
if (KT::issetAndNotEmpty($spam)) {
wp_die(__("Vyplnili jste nepovolený kontrolní prvek...", KT_DOMAIN));
exit;
}
if ($this->processMail($values)) {
wp_redirect(add_query_arg(self::PROCESSED_PARAM, "1", KT::getRequestUrl()));
exit;
}
}
}
add_action(KT_PROJECT_NOTICES_ACTION, array(&$this, "renderErrorNotice"));
}
}