本文整理匯總了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());
}
}