本文整理汇总了PHP中UrlHelper::GetActionUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlHelper::GetActionUrl方法的具体用法?PHP UrlHelper::GetActionUrl怎么用?PHP UrlHelper::GetActionUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UrlHelper
的用法示例。
在下文中一共展示了UrlHelper::GetActionUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionSend
public function actionSend()
{
/* @var $contacts LuxContactInfo */
$name = Yii::app()->request->getParam('name', null);
$email = Yii::app()->request->getParam('mail', null);
$message = Yii::app()->request->getParam('message', null);
$cap_id = Yii::app()->request->getParam('cap_id', null);
$cap = Yii::app()->request->getParam('cap', null);
$contacts = LuxContactInfo::model()->findAll();
if (count($contacts) > 0) {
$contact = $contacts[0];
} else {
$contact = new LuxContactInfo();
}
$success = false;
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
$captcha = new DwCaptcha();
if (strlen($message) < 7 || !$captcha->CheckCaptcha($cap, $cap_id)) {
$success = false;
}
if (strlen($message) > 7 && $captcha->CheckCaptcha($cap, $cap_id)) {
$subject = $contact->getLngObject(Yii::app()->language)->feedback_subject;
$to = $contact->administrator_email;
//send email
$headers = array();
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-type: text/plain; charset=iso-8859-1";
$headers[] = "From: " . $name . " <" . $email . ">";
$headers[] = "Subject: {$subject}";
$headers[] = "X-Mailer: PHP/" . phpversion();
$success = mail($to, $subject, $message, implode("\r\n", $headers));
}
}
if ($success) {
$this->redirect(UrlHelper::GetActionUrl('pages', 'index') . '#contacts');
} else {
$this->redirect(UrlHelper::GetActionUrl('pages', 'index', array('error' => 1)) . '#contacts');
}
}
示例2: DwCaptcha
<?php
/* @var $capObj CaptchaObject */
/* @var $error bool */
?>
<form method="post" action="<?php
echo UrlHelper::GetActionUrl('feedback', 'send');
?>
">
<div class="feedback-data">
<input type="text" name="name" placeholder="Name">
<input type="text" name="mail" placeholder="Mail">
<div class="captcha">
<p><?php
echo Translations::Translate('Enter symbols');
?>
<br> <?php
echo Translations::Translate('in the picture');
?>
</p>
<?php
$cap = new DwCaptcha();
$capObj = $cap->GetRandomCaptcha();
?>
<input type="hidden" name="cap_id" value="<?php
echo $capObj->GetId();
?>
">
<img style="width: 90px; height: 40px" src="<?php