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


PHP Request::redirect方法代码示例

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


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

示例1: save

 public function save()
 {
     if (isset($this->files->cat_picture['name']) and $this->files->cat_picture['name'] != '') {
         $dirname = UPLOAD_DIR . 'cats' . SEPD;
         $filename = date('YmdHis') . md5($this->files->cat_picture['name']) . '.' . end(explode('.', $this->files->cat_picture['name']));
         if (!is_dir($dirname)) {
             mkdir($dirname, 0777, true);
         }
         move_uploaded_file($this->files->cat_picture['tmp_name'], $dirname . $filename);
     }
     $mdl = Model::Factory('cats');
     $mdl->name = $this->post->cat_name;
     $mdl->description = $this->post->cat_desc;
     $mdl->full_description = $this->post->cat_full_desc;
     $mdl->social = $this->post->social;
     $mdl->playful = $this->post->playful;
     $mdl->lovely = $this->post->lovely;
     $mdl->special = 1;
     if (isset($filename)) {
         $mdl->picture = $filename;
     }
     if (isset($this->post->id)) {
         $mdl->where("id='{$this->post->id}'");
         $mdl->update();
     } else {
         $mdl->insert();
     }
     Request::redirect(HOST . 'adm/gatos-especiais/');
 }
开发者ID:alegalliard,项目名称:aug,代码行数:29,代码来源:SpecialCatsController.php

示例2: execute

 function execute()
 {
     $model = new connectionUserModel();
     $model->logout();
     Request::redirect('/');
     exit;
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:7,代码来源:connectionUserLogout.action.php

示例3: before

 public static function before()
 {
     if (Request::get('lang')) {
         $langList = array_map(function ($a) {
             return $a['iso'];
         }, Language::getList());
         $lang = strtolower(Request::get('lang'));
         if (in_array($lang, $langList)) {
             Request::cookie(self::$langKeyCookie, $lang);
         }
         Request::redirect(Request::url(array('lang' => '')));
     }
     if (Request::get('confirm_email')) {
         connectionUserModel::create()->confirmationEmailLink(Request::get('confirm_email'));
         Request::get('email_confirm', true);
     }
     if (ConnectionHelper::isLogin() && Request::get('status') && Request::get('status') == connectionUserModel::STATUS_MODERATE) {
         $userLogin = ConnectionHelper::userLogin();
         connectionUserModel::create()->changeStatus($userLogin['id'], connectionUserModel::STATUS_MODERATE, 'Пользователь отправил профиль на проверку.');
         Request::redirect('/profile/');
     }
     if (Request::get('auth') && !ConnectionHelper::isLogin()) {
         Request::redirect('/login/');
     }
     if (ConnectionHelper::isLogin()) {
         ConnectionHelper::updateUserActive();
     }
 }
开发者ID:Yogurt933,项目名称:Made-Easy,代码行数:28,代码来源:Connection.app.php

示例4: view

 /**
  * View announcement details.
  * @param $args array optional, first parameter is the ID of the announcement to display
  */
 function view($args = array())
 {
     $this->validate();
     $this->setupTemplate();
     $announcementId = !isset($args) || empty($args) ? null : (int) $args[0];
     $announcementDao =& DAORegistry::getDAO('AnnouncementDAO');
     if ($this->_getAnnouncementsEnabled() && $this->_announcementIsValid($announcementId)) {
         $announcement =& $announcementDao->getAnnouncement($announcementId);
         if ($announcement->getDateExpire() == null || strtotime($announcement->getDateExpire()) > time()) {
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->assign('announcement', $announcement);
             if ($announcement->getTypeId() == null) {
                 $templateMgr->assign('announcementTitle', $announcement->getLocalizedTitle());
             } else {
                 $templateMgr->assign('announcementTitle', $announcement->getAnnouncementTypeName() . ": " . $announcement->getLocalizedTitle());
             }
             $templateMgr->append('pageHierarchy', array(PKPRequest::url(null, 'announcement'), 'announcement.announcements'));
             $templateMgr->display('announcement/view.tpl');
         } else {
             Request::redirect(null, null, 'announcement');
         }
     } else {
         Request::redirect(null, null, 'announcement');
     }
 }
开发者ID:anorton,项目名称:pkp-lib,代码行数:29,代码来源:PKPAnnouncementHandler.inc.php

示例5: managePlugins

 /**
  * Display a list of plugins along with management options.
  */
 function managePlugins($args)
 {
     $this->validate();
     $path = isset($args[0]) ? $args[0] : null;
     $category = isset($args[1]) ? $args[1] : null;
     $plugin = isset($args[2]) ? $args[2] : null;
     switch ($path) {
         case 'install':
             $this->showInstallForm();
             break;
         case 'installPlugin':
             $this->uploadPlugin('install');
             break;
         case 'upgrade':
             $this->showUpgradeForm($category, $plugin);
             break;
         case 'upgradePlugin':
             $this->uploadPlugin('upgrade', $category, $plugin);
             break;
         case 'delete':
             $this->showDeleteForm($category, $plugin);
             break;
         case 'deletePlugin':
             $this->deletePlugin($category, $plugin);
             break;
         default:
             Request::redirect(null, 'manager', 'plugins');
     }
     $this->setupTemplate(true);
 }
开发者ID:ramonsodoma,项目名称:ojs,代码行数:33,代码来源:PluginManagementHandler.inc.php

示例6: delete

 public function delete()
 {
     $m = Model::Factory('want_to_adopt');
     $m->where("id=" . $this->get->id);
     $m->delete();
     Request::redirect(HOST . 'adm/querem-adotar/');
 }
开发者ID:alegalliard,项目名称:aug,代码行数:7,代码来源:WantToAdoptController.php

示例7: delete

 public function delete()
 {
     $m = Model::Factory('newsletter');
     $m->where("id='{$this->get->id}'");
     $m->delete();
     Request::redirect(HOST . 'adm/newsletter');
 }
开发者ID:alegalliard,项目名称:aug,代码行数:7,代码来源:NewsletterController.php

示例8: handleRequest

/**
 * Handle a new request.
 */
function handleRequest()
{
    if (!Config::getVar('general', 'installed') && pageRequiresInstall()) {
        // Redirect to installer if application has not been installed
        Request::redirect(null, 'install');
    }
    // Determine the handler for this request
    $page = Request::getRequestedPage();
    $op = Request::getRequestedOp();
    $sourceFile = sprintf('pages/%s/index.php', $page);
    // If a hook has been registered to handle this page, give it the
    // opportunity to load required resources and set HANDLER_CLASS.
    if (!HookRegistry::call('LoadHandler', array(&$page, &$op, &$sourceFile))) {
        if (file_exists($sourceFile)) {
            require $sourceFile;
        } else {
            require 'pages/index/index.php';
        }
    }
    if (!defined('SESSION_DISABLE_INIT')) {
        // Initialize session
        $sessionManager =& SessionManager::getManager();
        $session =& $sessionManager->getUserSession();
    }
    $methods = array_map('strtolower', get_class_methods(HANDLER_CLASS));
    if (in_array(strtolower($op), $methods)) {
        // Call a specific operation
        call_user_func(array(HANDLER_CLASS, $op), Request::getRequestedArgs());
    } else {
        // Call the selected handler's index operation
        call_user_func(array(HANDLER_CLASS, 'index'), Request::getRequestedArgs());
    }
}
开发者ID:LiteratimBi,项目名称:jupitertfn,代码行数:36,代码来源:index.php

示例9: __construct

 public function __construct(Request $request)
 {
     if (!Session::instance()->get('user')) {
         $request->redirect('oauth/signin');
     }
     parent::__construct($request);
 }
开发者ID:hegelmax,项目名称:OAuth-2.0,代码行数:7,代码来源:server.php

示例10: managePlugins

 /**
  * Display a list of plugins along with management options.
  */
 function managePlugins($args)
 {
     $path = isset($args[0]) ? $args[0] : null;
     $plugin = isset($args[1]) ? $args[1] : null;
     switch ($path) {
         case 'install':
             PluginManagementHandler::showInstallForm();
             break;
         case 'installPlugin':
             PluginManagementHandler::uploadPlugin('install');
             break;
         case 'upgrade':
             PluginManagementHandler::showUpgradeForm($plugin);
             break;
         case 'upgradePlugin':
             PluginManagementHandler::uploadPlugin('upgrade');
             break;
         case 'delete':
             PluginManagementHandler::showDeleteForm($plugin);
             break;
         case 'deletePlugin':
             PluginManagementHandler::deletePlugin($plugin);
             break;
         default:
             Request::redirect(null, 'manager', 'plugins');
     }
     $this->setupTemplate(true);
 }
开发者ID:jalperin,项目名称:ocs,代码行数:31,代码来源:PluginManagementHandler.inc.php

示例11: view

 /**
  * View announcement details.
  * @param $args array optional, first parameter is the ID of the announcement to display 
  */
 function view($args = array())
 {
     AnnouncementHandler::setupTemplate();
     $journal =& Request::getJournal();
     $announcementsEnabled = $journal->getSetting('enableAnnouncements');
     $announcementId = !isset($args) || empty($args) ? null : (int) $args[0];
     $announcementDao =& DAORegistry::getDAO('AnnouncementDAO');
     if ($announcementsEnabled && $announcementId != null && $announcementDao->getAnnouncementJournalId($announcementId) == $journal->getJournalId()) {
         $announcement =& $announcementDao->getAnnouncement($announcementId);
         if ($announcement->getDateExpire() == null || strtotime($announcement->getDateExpire()) > time()) {
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->assign('announcement', $announcement);
             if ($announcement->getTypeId() == null) {
                 $templateMgr->assign('announcementTitle', $announcement->getAnnouncementTitle());
             } else {
                 $templateMgr->assign('announcementTitle', $announcement->getAnnouncementTypeName() . ": " . $announcement->getAnnouncementTitle());
             }
             $templateMgr->append('pageHierarchy', array(Request::url(null, 'announcement'), 'announcement.announcements'));
             $templateMgr->display('announcement/view.tpl');
         } else {
             Request::redirect(null, null, 'announcement');
         }
     } else {
         Request::redirect(null, null, 'announcement');
     }
 }
开发者ID:LiteratimBi,项目名称:jupitertfn,代码行数:30,代码来源:AnnouncementHandler.inc.php

示例12: display

 /**
  * @see ReportPlugin::display()
  */
 function display(&$args)
 {
     parent::display($args);
     $journal =& Request::getJournal();
     $reportArgs = array('metricType' => OJS_METRIC_TYPE_COUNTER, 'columns' => array(STATISTICS_DIMENSION_ASSOC_ID, STATISTICS_DIMENSION_ASSOC_TYPE, STATISTICS_DIMENSION_CONTEXT_ID, STATISTICS_DIMENSION_ISSUE_ID, STATISTICS_DIMENSION_MONTH, STATISTICS_DIMENSION_COUNTRY), 'filters' => serialize(array(STATISTICS_DIMENSION_CONTEXT_ID => $journal->getId())), 'orderBy' => serialize(array(STATISTICS_DIMENSION_MONTH => STATISTICS_ORDER_ASC)));
     Request::redirect(null, null, 'generateReport', null, $reportArgs);
 }
开发者ID:EreminDm,项目名称:water-cao,代码行数:10,代码来源:UsageStatsReportPlugin.inc.php

示例13: display

 function display(&$args)
 {
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_OCS_MANAGER));
     $this->import('PaperFormSettings');
     $form = new PaperFormSettings($this, $conference->getId());
     if (Request::getUserVar('GenerateReport')) {
         $ReportHandlerDAO =& DAORegistry::getDAO('MultiPaperReportDAO');
         $iterator =& $ReportHandlerDAO->getPaperReport($conference->getId(), $schedConf->getId());
         $form->readInputData();
         if ($form->validate()) {
             $form->execute();
             $custom_Class = $form->getData('reportClass');
             if (class_exists($custom_Class)) {
                 $Report = new $custom_Class($iterator, $this);
                 $Report->makeReport();
                 Request::redirect(null, null, 'manager', 'plugin');
             } else {
                 echo Locale::translate('plugins.reports.MultiGeneratorPaperReport.classNotFound');
                 $form->display();
             }
         } else {
             $this->setBreadCrumbs(true);
             $form->makeOptions();
             $form->display();
         }
     } else {
         $this->setBreadCrumbs(true);
         $form->initData();
         $form->display();
     }
 }
开发者ID:sedici,项目名称:ocs,代码行数:33,代码来源:MultiPaperReportPlugin.inc.php

示例14: AttachFiles

 public function AttachFiles()
 {
     if (!$this->isLoggedIn) {
         return;
     }
     #Goodbye, XSS
     if ($this->session->accept_token != REQUEST_TOKEN) {
         Request::redirect(HOST . 'login');
         return;
     }
     $o = new stdClass();
     //Validação simples do tipo do arquivo
     list($w, $h) = getimagesize($this->files->file->tmp_name);
     if (!$w or !$h) {
         $o->status = false;
         $o->message = 'Formato de arquivo inválido';
     } else {
         $ext = @end(explode('.', $this->files->file->name));
         $new_filename = @md5(date('YmdHis') . $this->files->file->name) . '.' . $ext;
         if (!is_dir(POST_IMAGES_UPLOAD_DIR)) {
             mkdir(POST_IMAGES_UPLOAD_DIR, 0775, true);
         }
         $upload = move_uploaded_file($this->files->file->tmp_name, POST_IMAGES_UPLOAD_DIR . $new_filename);
         if ($upload) {
             $o->status = true;
             $o->filelink = POST_IMAGES_DIR . $new_filename;
         } else {
             $o->status = false;
             $o->message = 'Falha ao salvar o arquivo';
         }
     }
     header("Content-type:text/html;charset=utf-8");
     die(json_encode($o));
 }
开发者ID:Anpix,项目名称:rede-social,代码行数:34,代码来源:PostsAttachmentsController.php

示例15: delete

 public function delete()
 {
     $m = Model::Factory('billboard');
     $m->where("id={$this->get->id}");
     $m->delete();
     Request::redirect(HOST . 'adm/destaques/');
 }
开发者ID:alegalliard,项目名称:aug,代码行数:7,代码来源:BillBoardController.php


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