本文整理汇总了PHP中Render::msg方法的典型用法代码示例。如果您正苦于以下问题:PHP Render::msg方法的具体用法?PHP Render::msg怎么用?PHP Render::msg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Render
的用法示例。
在下文中一共展示了Render::msg方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
function update($params)
{
$c = $this->updated_companies[0];
$c->save();
Render::msg($c->getName() . ' Updated.');
$this->redirectTo(array('controller' => 'Company', 'action' => 'show', 'id' => $c->id));
}
示例2: destroy
function destroy($params)
{
$params['id'] ? $clientuser = new ClientUser($params['id']) : bail('no company selected');
$name = $clientuser->getName();
$clientuser->destroy();
Render::msg($name . ' Deleted.', 'bad');
$this->redirectTo(array('controller' => 'ClientUser', 'action' => 'index'));
}
示例3: update
function update($params)
{
$staff = $this->updated_staffs[0];
if (!empty($params['new_password'])) {
Render::msg('Password Changed');
$staff->setPassword($params['new_password']);
}
$staff->save();
$this->redirectTo(array('controller' => 'Staff', 'action' => 'show', 'id' => $staff->id));
}
示例4: create
function create($params)
{
$p = $this->new_payments[0];
$p->save();
if ($params['noemail'] == 1) {
Render::msg('No Email Sent');
} else {
$p->sendEmail();
}
isset($params['redirect']) ? $redirect = $params['redirect'] : ($redirect = array('controller' => 'Payment', 'action' => 'index'));
$this->redirectTo($redirect);
Render::msg('Payment Saved');
}
示例5: create_session
function create_session($params)
{
$email = $params['email'];
$password = sha1($params['password']);
// search for users in this order
$user_classes = array('ClientUser', 'Staff');
foreach ($user_classes as $user_class) {
$user = $user_class::getOne(array('email' => $email, 'password' => $password));
if ($user) {
Session::startSession($user->id, $user->getUserType());
if ($user_class == 'Staff') {
$this->redirectTo(array('controller' => 'Staff', 'action' => 'show', 'id' => $user->id));
} else {
if ($user_class == 'ClientUser') {
$this->redirectTo(array('controller' => 'Client', 'action' => 'index'));
}
}
return;
}
}
// no user found
Render::msg('Invalid Email or Password', 'bad');
$this->redirectTo(array('controller' => 'Authenticate', 'action' => 'login', 'email' => $email));
}
示例6: sendEmail
function sendEmail()
{
//if(!isset($this->id)) bail("must haz id to do that!");
$d = new PHP5_Accessor();
$d->payment = $this;
$d->company = $this->getCompany();
$r = getRenderer();
$htmlcontent = $r->view('paymentReceiptEmail', $d);
$plaincontent = $r->view('paymentReceiptEmailPlain', $d);
$email_address = $this->getBillingEmailAddress();
$subject = 'Radical Designs Payment Receipt ' . Util::pretty_date($this->get('date'));
$boundary = "nextPart";
$headers = 'From: ' . BILLING_EMAIL_ADDRESS . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/alternative; boundary = {$boundary}\r\n\r\n";
$headers .= "This is a MIME encoded message.\r\n\r\n";
$headers .= "\r\n--{$boundary}\r\n";
// beginning \n added to separate previous content
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= $plaincontent;
$headers .= "\r\n\r\n--{$boundary}\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= $htmlcontent;
$email_sent = mail($email_address, $subject, "", $headers);
if ($email_sent) {
Render::msg('Email Sent');
} else {
Render::msg('Email Failed To Send', 'bad');
}
}
示例7: sendEmail
function sendEmail()
{
if (!isset($this->id)) {
bail("must haz id to do that!");
}
//trigger_error('Invoice #'.$this->id.' preparing to send email');
$d = new PHP5_Accessor();
$d->invoice = $this;
$d->company = $this->getCompany();
$r = getRenderer();
$htmlcontent = $r->view('invoiceEmail', $d);
$plaincontent = $r->view('invoiceEmailPlain', $d);
$email_address = $this->getBillingEmailAddress() . $this->getAdditionalRecipients();
if ($this->getType() == 'dated') {
$subject = 'Radical Designs Invoice ' . Util::pretty_date($this->get('end_date'));
} else {
$subject = 'Radical Designs Invoice ' . Util::pretty_date($this->get('date'));
}
$boundary = "nextPart";
$headers = 'From: ' . BILLING_EMAIL_ADDRESS . "\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/alternative; boundary = {$boundary}\n\n";
$headers .= "This is a MIME encoded message.\n\n";
$headers .= "\n--{$boundary}\n";
// beginning \n added to separate previous content
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= $plaincontent;
$headers .= "\n\n--{$boundary}\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= $htmlcontent;
$email_sent = mail($email_address, $subject, "", $headers);
if ($email_sent) {
$this->set(array('sent_date' => Util::date_format(), 'status' => 'sent'));
Render::msg('Email Sent');
} else {
$this->set(array('status' => 'failed'));
Render::msg('Email Failed To Send', 'bad');
}
$this->save();
}