本文整理汇总了PHP中request::referer方法的典型用法代码示例。如果您正苦于以下问题:PHP request::referer方法的具体用法?PHP request::referer怎么用?PHP request::referer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类request
的用法示例。
在下文中一共展示了request::referer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
public static function header($form = array())
{
if (isset($form['template'])) {
form::$template = arr::take('template', $form);
}
$attrs['class'] = isset($form['class']) ? $form['class'] : 'form';
$attrs['method'] = isset($form['method']) ? $form['method'] : 'post';
$attrs['action'] = isset($form['action']) ? $form['action'] : url::current();
//加载表头
$html[] = '';
$html[] = '<form' . html::attributes($attrs) . '>';
$html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
$html[] = field::hidden(array('name' => '_FORMHASH', 'value' => form::hash()));
//加载常用js
$html[] = html::script(url::common() . '/js/jquery.validate.js');
$html[] = html::script(url::common() . '/js/jquery.validate.additional.js');
$html[] = html::script(url::common() . '/js/jquery.form.js');
//表单头部
if (isset($form['title']) || isset($form['description'])) {
$html[] = '<div class="form-header clearfix">';
$html[] = isset($form['icon']) ? ' <div class="form-icon"></div>' : '';
$html[] = isset($form['title']) ? ' <div class="form-title">' . $form['title'] . '</div>' : '';
$html[] = isset($form['description']) ? ' <div class="form-description">' . $form['description'] . '</div>' : '';
$html[] = '</div>';
}
//表单body部分开始
$html[] = '<div class="form-body">';
echo implode("\n", $html);
}
示例2: actionDelete
public function actionDelete($id)
{
$file = zotop::model('zotop.file');
$delete = $file->delete($id);
if ($delete) {
msg::success('删除成功', request::referer());
}
}
示例3: header
public static function header($header = array())
{
if (isset($header['template'])) {
form::$template = arr::take('template', $header);
}
$attrs['class'] = isset($header['class']) ? $header['class'] : 'form';
$attrs['method'] = isset($header['method']) ? $header['method'] : 'post';
$attrs['action'] = isset($header['action']) ? $header['action'] : url::current();
$html[] = '';
$html[] = '<form' . html::attributes($attrs) . '>';
$html[] = isset($header['title']) ? '<div class="form-title">' . $header['title'] . '</div>' : '';
$html[] = isset($header['description']) ? '<div class="form-description">' . $header['description'] . '</div>' : '';
$html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
$html[] = html::script(url::common() . '/js/jquery.validate.js');
$html[] = html::script(url::common() . '/js/jquery.validate.additional.js');
$html[] = html::script(url::common() . '/js/jquery.form.js');
$html[] = html::script(url::common() . '/js/zotop.form.js');
echo implode("\n", $html);
}
示例4: header
public static function header($form = array())
{
if (is_string($form)) {
$form['description'] = $form;
}
form::$template = isset($form['template']) ? $form['template'] : form::$template;
form::$globalid = isset($form['globalid']) ? $form['globalid'] : form::$globalid;
//form 标签
$attrs['class'] = isset($form['class']) ? $form['class'] : 'form';
$attrs['method'] = isset($form['method']) ? $form['method'] : 'post';
$attrs['target'] = isset($form['target']) ? $form['target'] : '';
$attrs['action'] = isset($form['action']) ? $form['action'] : url::location();
if (isset($form['enctype']) || isset($form['upload'])) {
$attrs['enctype'] = 'multipart/form-data';
}
//加载表头
$html[] = '';
$html[] = '<form' . html::attributes($attrs) . '>';
$html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
$html[] = field::hidden(array('name' => '_FORMHASH', 'value' => form::hash()));
$html[] = field::hidden(array('name' => '_GLOBALID', 'value' => form::globalid()));
//加载常用js
if ($form['valid'] !== false) {
$html[] = html::script(ZOTOP_APP_URL_JS . '/jquery.validate.js');
}
if ($form['ajax'] !== false) {
$html[] = html::script(ZOTOP_APP_URL_JS . '/jquery.form.js');
}
//表单头部
if (isset($form['title']) || isset($form['description'])) {
$html[] = '<div class="form-header clearfix">';
$html[] = isset($form['title']) ? ' <div class="form-title">' . $form['title'] . '</div>' : '';
$html[] = isset($form['description']) ? ' <div class="form-description">' . $form['description'] . '</div>' : '';
$html[] = '</div>';
}
//表单body部分开始
$html[] = '<div class="form-body">';
echo implode("\n", $html);
}