本文整理汇总了PHP中Alert::warning方法的典型用法代码示例。如果您正苦于以下问题:PHP Alert::warning方法的具体用法?PHP Alert::warning怎么用?PHP Alert::warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alert
的用法示例。
在下文中一共展示了Alert::warning方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createAction
/**
* 新建页面
* @author zhangteng
*/
public function createAction()
{
//判断是否有值提交
if ($this->getRequest()->isPost()) {
//内容插入数据库
$ret = $this->Keyword->replace_keywords_add(['id' => $this->getRequest()->getPost('id', 0), 'description' => trim($this->getRequest()->getPost('desc', '')), 'keywords' => trim($this->getRequest()->getPost('keywords', '')), 'replace_words' => trim($this->getRequest()->getPost('replace', ''))]);
if ($ret) {
Alert::success('添加成功!');
Yaf_Controller_Abstract::redirect("/admin/replace/index");
exit;
} else {
Alert::warning('关键词已存在或非法字符');
$referer = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : '/admin/replace/index';
$this->redirect($referer);
exit;
}
}
$this->getView()->assign('data', $data);
}
示例2: createAction
/**
* 新建页面
* @author zhangteng
*/
public function createAction()
{
//判断是否有值提交
if ($this->getRequest()->isPost()) {
//内容插入数据库
$ret = $this->Keyword->content_keywords_add(['id' => intval($this->getRequest()->getPost('id', 0)), 'description' => trim($this->getRequest()->getPost('desc', '')), 'keywords' => trim($this->getRequest()->getPost('keywords', '')), 'href_url' => filter_var($this->getRequest()->getPost('href_url'), FILTER_VALIDATE_URL) ? $this->getRequest()->getPost('href_url') : '#']);
if ($ret) {
Alert::success('添加成功!');
Yaf_Controller_Abstract::redirect("/admin/keyword/index");
exit;
} else {
Alert::warning('关键词已存在或非法字符');
$referer = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : '/admin/keyword/index';
$this->redirect($referer);
exit;
}
}
$this->getView()->assign('data', $data);
}
示例3:
<?php
Action::run('admin_header');
?>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
<![endif]-->
</head>
<body class="login-body">
<?php
// Monstra Notifications
Notification::get('success') and Alert::success(Notification::get('success'));
Notification::get('warning') and Alert::warning(Notification::get('warning'));
Notification::get('error') and Alert::error(Notification::get('error'));
?>
<div class="container form-signin">
<div class="text-center"><a class="brand" href="<?php
echo Option::get('siteurl');
?>
/admin"><img src="<?php
echo Option::get('siteurl');
?>
/public/assets/img/monstra-logo-256px.png" alt="monstra" /></a></div>
<div class="administration-area well">
<div>
<form method="post">
示例4: batchtrashAction
public function batchtrashAction()
{
$referer = isset($_SERVER["HTTP_REFERER"]) ? str_replace('http://' . $_SERVER['HTTP_HOST'], '', $_SERVER["HTTP_REFERER"]) : '/admin/document/index';
if ($this->getRequest()->isPost()) {
if (empty($this->getRequest()->getPost())) {
Alert::warning('没有选中任何文章!');
} else {
$data = $this->getRequest()->getPost();
//删除db
$ret = $this->db_document->batch_trash(['id' => $data['id']]);
//删除缓存
foreach ($data['id'] as $id) {
$memkey = MEMPREFIX . 'article:detail' . $id;
$this->memcache->delete($memkey);
}
if ($ret) {
Alert::success('删除成功!');
} else {
Alert::success('删除失败!');
}
}
} else {
Alert::warning('删除失败!');
}
$this->redirect($referer);
}