当前位置: 首页>>代码示例>>PHP>>正文


PHP Redirect::error方法代码示例

本文整理汇总了PHP中Redirect::error方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::error方法的具体用法?PHP Redirect::error怎么用?PHP Redirect::error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Redirect的用法示例。


在下文中一共展示了Redirect::error方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createPage

function createPage($smarty)
{
    if (!Users::isAdmin()) {
        Redirect::error(403);
    }
    $smarty->assign('edit_headers', Queries::itemListHeaders(Input::get('table', 'get')));
    $smarty->assign('edit_table', Queries::itemList(Input::get('table', 'get')));
    return $smarty;
}
开发者ID:Wicloz,项目名称:UniversityWebsite,代码行数:9,代码来源:edit-table.php

示例2: createPage

function createPage($smarty)
{
    $item = Queries::examWithId(Input::get('id', 'get'));
    if (empty($item->id)) {
        Redirect::error(404);
    }
    $smarty->assign('item', $item);
    $smarty->assign('table_parentT', 'exams');
    $smarty->assign('table_parentI', $item->id);
    $smarty->assign('planning', Tables::planning(true, 'exams', $item->id));
    return $smarty;
}
开发者ID:Wicloz,项目名称:UniversityWebsite,代码行数:12,代码来源:exams_item.php

示例3: get_index

 public function get_index($category, $title, $id, $idparent = null)
 {
     $id = !is_null($idparent) ? $idparent : $id;
     $article = Article::find($id);
     // || strcmp($title,$article->title)!=0
     if (is_null($article)) {
         return Redirect::error(404);
     }
     $article->categoryName = $article->Category()->first()->getCategoryFullName();
     $article->categoryUrl = $article->Category()->first()->getCategoryUrl();
     return View::make('visitor.article_content', array('article' => $article));
 }
开发者ID:gischen,项目名称:PHP-CMS,代码行数:12,代码来源:articlecontent.php

示例4: createPage

function createPage($smarty)
{
    $subject = DB::instance()->get("subjects", array("", "abbreviation", "=", Input::get('subject', 'get')))->first();
    if (empty($subject->id)) {
        Redirect::error(404);
    }
    $smarty->assign('subject', $subject);
    $smarty->assign('links', json_decode($subject->links));
    $smarty->assign('events', Tables::events(true, $subject->abbreviation));
    $smarty->assign('table_parentT', 'subjects');
    $smarty->assign('table_parentI', $subject->id);
    $smarty->assign('planning', Tables::planning(true, 'subjects', $subject->id));
    return $smarty;
}
开发者ID:Wicloz,项目名称:UniversityWebsite,代码行数:14,代码来源:subjects.php

示例5: createPage

function createPage($smarty)
{
    if (!Users::isAdmin()) {
        Redirect::error(403);
    }
    if (Input::exists() && Input::get('action') === 'admin_item_insert') {
        Update::adminInsertItem();
    }
    if (Input::exists() && Input::get('action') === 'admin_item_update') {
        Update::adminUpdateItem();
    }
    if (Input::exists() && Input::get('action') === 'admin_item_delete') {
        Update::adminDeleteItem();
    }
    $smarty->assign('columns', Queries::editableEntry(Input::get('table', 'get'), Input::get('id', 'get')));
    return $smarty;
}
开发者ID:Wicloz,项目名称:UniversityWebsite,代码行数:17,代码来源:edit-entry.php

示例6: get_edit

 public function get_edit($id)
 {
     $data['title'] = "Edit Palette";
     $data['lead'] = "Edit your palette's details";
     $data['tabs'][] = array('All', URL::to('litmus/palettes'));
     $data['tabs'][] = array('View', URL::to('litmus/palettes/' . $id));
     $data['tabs'][] = array('Edit', URL::to('litmus/palettes/' . $id . '/edit'), 'active');
     $data['object'] = Palette::find($id);
     if (!$data['object']) {
         return Redirect::error(404);
     }
     $data['url'] = URL::to('litmus/palettes/' . $id);
     $data['verb'] = 'PUT';
     $data['fields'] = Config::get('litmus::config.form.palette');
     $data['content'] = View::make('litmus::partials.form', $data)->render();
     return $this->layout($data);
 }
开发者ID:aaronbullard,项目名称:litmus,代码行数:17,代码来源:palettes.php

示例7: function

<?php

Route::get('documents', function () {
    $path = URL::current();
    return array('GET ' . $path . '/:id' => 'Retrieve data about a specific document', 'POST ' . $path => 'Create a new document', 'POST ' . $path . '/:id' => 'Update a document', 'DELETE ' . $path . '/:id' => 'Delete a document');
});
Route::get('documents/(:num)', function ($id) {
    if ($doc = Document::get($id)) {
        return $doc;
    }
    return Redirect::error('404');
});
开发者ID:richthegeek,项目名称:Sasshare,代码行数:12,代码来源:index.php

示例8: itemListHeaders

 public static function itemListHeaders($table)
 {
     $info = DB::tableFormInfo($table);
     if (empty($info)) {
         Redirect::error(404);
     }
     return extractFields($info, 'COLUMN_NAME');
 }
开发者ID:Wicloz,项目名称:UniversityWebsite,代码行数:8,代码来源:Queries.php

示例9: error

 /**
  * 如果用户没有通行权,则进行什么操作
  *
  * @return viod
  */
 public function error($msg, $url)
 {
     \Redirect::error($msg, $url);
 }
开发者ID:minowu,项目名称:smartthink,代码行数:9,代码来源:Auth.php

示例10: adminDeleteItem

 public static function adminDeleteItem()
 {
     if (Users::isAdmin()) {
         $validation = new Validate();
         $validation->check($_POST, array('action' => array('name' => 'Action', 'required' => true, 'wildcard' => 'admin_item_delete'), 'table' => array('name' => 'Table Name', 'required' => true), 'id' => array('name' => 'Entry ID', 'required' => true)));
         if ($validation->passed()) {
             DB::instance()->delete(Input::get('table'), array("", "id", "=", Input::get('id')));
             if (Input::get('table') === Users::safeSid() . '_assignments') {
                 Calendar::deleteAssignment(Input::get('id'));
             }
             Notifications::addSuccess('Entry deleted!');
             Redirect::to('?page=home');
         } else {
             Notifications::addValidationFail($validation->getErrors());
         }
     } else {
         Redirect::error(403);
     }
 }
开发者ID:Wicloz,项目名称:UniversityWebsite,代码行数:19,代码来源:Update.php

示例11: Smarty

<?php

require_once 'app/core/init.php';
require_once 'main.php';
if (isset($_GET['page']) && !empty($_GET['page'])) {
    $smarty = new Smarty();
    $smarty->debugging = Config::get('debug/smartyDebug');
    $smarty->caching = Config::get('smarty/caching');
    $smarty->cache_lifetime = Config::get('smarty/cache_lifetime');
    $cache_id = md5(json_encode($_GET) . json_encode($_POST) . Notifications::getAsJson());
    $pageFile = 'app/pages/' . $_GET['page'] . '.php';
    $templateFile = 'templates/pages/' . $_GET['page'] . '.tpl';
    if (file_exists($pageFile) && file_exists($templateFile)) {
        require $pageFile;
        if (!$allowCaching) {
            $cache_id = md5($cache_id . Hash::hashUnique());
        }
        if (!$smarty->isCached($templateFile, $cache_id)) {
            $smarty = createPage($smarty);
            $smarty = pageAddMain($smarty);
        }
        $smarty = pageAddMessages($smarty);
        $smarty->loadFilter("output", "trimwhitespace");
        $smarty->display($templateFile, $cache_id);
    } else {
        Redirect::error(404);
    }
} else {
    Redirect::to('?page=home');
}
开发者ID:Wicloz,项目名称:UniversityWebsite,代码行数:30,代码来源:index.php


注:本文中的Redirect::error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。