本文整理汇总了PHP中url::referer方法的典型用法代码示例。如果您正苦于以下问题:PHP url::referer方法的具体用法?PHP url::referer怎么用?PHP url::referer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类url
的用法示例。
在下文中一共展示了url::referer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
public static function header($form = array())
{
if (is_string($form) || is_numeric($form)) {
$form = array('globalid' => $form);
}
if (is_array($form)) {
$form += array('class' => 'form', 'method' => 'post', 'action' => url::location(), 'globalid' => 0);
}
$html[] = '';
if (arr::take('valid', $form) !== false) {
$html[] = html::script('$common/js/jquery.validate.js');
}
if (arr::take('ajax', $form) !== false) {
$html[] = html::script('$common/js/jquery.form.js');
}
$icon = arr::take('icon', $form);
$title = arr::take('title', $form);
$description = arr::take('description', $form);
$globalid = arr::take('globalid', $form);
$template = arr::take('template', $form);
if (!empty($template)) {
form::$template = $template;
}
//加载表头
$html[] = '<form' . html::attributes($form) . '>';
$html[] = field::hidden(array('name' => '_REFERER', 'value' => url::referer()));
$html[] = field::hidden(array('name' => '_FORMHASH', 'value' => form::hash()));
$html[] = field::hidden(array('name' => '_GLOBALID', 'value' => empty($globalid) ? form::globalid() : $globalid));
//表单头部
if (isset($title) || isset($description)) {
$html[] = '<div class="form-header clearfix">';
if (isset($icon)) {
$html[] = '<div class="form-icon"><div class="zotop-icon zotop-icon-' . $icon . '"></div></div>';
}
if (isset($title)) {
$html[] = ' <div class="form-title">' . $title . '</div>';
}
if (isset($description)) {
$html[] = ' <div class="form-description">' . $description . '</div>';
}
$html[] = '</div>';
}
$html[] = '<div class="form-body clearfix">';
$html[] = '';
echo implode("\n", $html);
}
示例2: actionDelete
public function actionDelete($file)
{
$file = empty($file) ? zotop::get('file') : $file;
$file = trim(url::decode($file), '/');
$filepath = site::template($file);
if (file::delete($filepath)) {
msg::success('删除成功', url::referer());
}
msg::error('删除失败');
}
示例3: actionDelete
public function actionDelete($id)
{
$category = zotop::model('content.category');
$category->id = $id;
$category->delete();
if (!$category->error()) {
msg::success('删除成功', url::referer());
}
msg::error($category->msg());
}
示例4: actionOperation
public function actionOperation()
{
$blog = zotop::model('blog.blog');
$id = (array) $_POST['id'];
$operation = $_POST['operation'];
foreach ($id as $i) {
switch ($operation) {
case 'delete':
$blog->delete($i);
break;
case 'status100':
$blog->update(array('status' => 100), $i);
break;
case 'status-50':
$blog->update(array('status' => -50), $i);
break;
case 'status-1':
$blog->update(array('status' => -1), $i);
break;
case 'status0':
$blog->update(array('status' => 0), $i);
break;
case 'order':
if (!is_numeric($_POST['order'])) {
$blog->error(1, '权重必须是数字');
} else {
$blog->update(array('order' => $_POST['order']), $i);
}
break;
case 'move':
$blog->update(array('categoryid' => $_POST['categoryid']), $i);
break;
default:
break;
}
}
if (!$blog->error()) {
msg::success('操作成功', url::referer());
}
msg::error($blog->msg());
}
示例5: actionDelete
public function actionDelete($id, $referer = '')
{
$file = zotop::model('system.file');
$delete = $file->delete($id);
if ($delete) {
msg::success('图片删除成功', url::referer());
}
}