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


PHP SC::transfer方法代码示例

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


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

示例1: delete

 public function delete()
 {
     $api = new SCApi();
     $arr = $api->usersessions_delete(true);
     if ($arr["loggedout"]) {
         SC::transfer();
     }
 }
开发者ID:jeffreytierney,项目名称:switchcomb,代码行数:8,代码来源:usersessions.php

示例2: invitations_create

 public function invitations_create()
 {
     SC::loginRequired();
     global $current_user;
     try {
         $api = new SCApi();
         $sent_list = $api->boards_invitations_create();
         SC::transfer(SCRoutes::set("boards", "show", array("boardid" => $_GET["boardid"])));
     } catch (Exception $ex) {
         SC::setFlashMessage($ex->getMessage(), "error");
         $this->invitations_new();
     }
 }
开发者ID:jeffreytierney,项目名称:switchcomb,代码行数:13,代码来源:boards.php

示例3: delete

 public function delete()
 {
     SC::loginRequired();
     global $current_user;
     try {
         $api = new SCApi();
         if ($api->memberships_delete()) {
             SC::transfer(SCRoutes::set("users", "memberships_index", array("userid" => $current_user->userid)));
         } else {
             throw new Exception("something went wrong");
         }
     } catch (Exception $ex) {
         SC::setFlashMessage($ex->getMessage(), "error");
         $this->show(true);
     }
 }
开发者ID:jeffreytierney,项目名称:switchcomb,代码行数:16,代码来源:memberships.php

示例4: create

 public function create()
 {
     SC::loginRequired();
     global $current_user;
     switch ($_GET["__content_type"]) {
         case "json":
             $api = new SCApi();
             $thread = $api->boards_threads_create();
             $output = array("transfer" => SCRoutes::set("threads", "show", array("boardid" => $thread->boardid, "threadid" => $thread->messageid)));
             echo SC::jsonify($output);
             break;
         case "html":
         default:
             try {
                 $api = new SCApi();
                 $thread = $api->boards_threads_create();
                 SC::transfer(SCRoutes::set("threads", "show", array("boardid" => $thread->boardid, "threadid" => $thread->messageid)));
             } catch (Exception $ex) {
                 SC::setFlashMessage($ex->getMessage(), "error");
                 $this->_new();
             }
     }
 }
开发者ID:jeffreytierney,项目名称:switchcomb,代码行数:23,代码来源:threads.php

示例5: go_to

 public function go_to()
 {
     SC::transfer("board.php?boardid=" . $this->boardid);
 }
开发者ID:jeffreytierney,项目名称:switchcomb,代码行数:4,代码来源:SCBoard.php

示例6: Exception

<?php

require_once "config/environment.php";
require_once "sc_lib.php";
try {
    if (strpos($_SERVER["REQUEST_URI"], "index.php") > -1) {
        SC::transfer();
    }
    $uri = $_SERVER["REQUEST_URI"];
    $route_parts = SCRoutes::parseUrl();
    if (!$route_parts) {
        throw new Exception("This page does not exist", 404);
    }
    $route_parts["__content_type"] = SC::getResponseContentType();
    $_GET = array_merge($_GET, $route_parts);
    //var_dump($route_parts);
    $controller_file = SCBASEPATH . "/controllers/" . $route_parts["controller"] . ".php";
    if (file_exists($controller_file)) {
        require_once $controller_file;
        if ($controller) {
            if (method_exists($controller, $route_parts["action"])) {
                $controller->{$route_parts}["action"]();
            } else {
                throw new Exception("The " . $route_parts["action"] . " action has not been defined for the " . $route_parts["controller"] . " controller.", 500);
            }
        } else {
            throw new Exception("The " . $route_parts["controller"] . " controller has not been initialized", 500);
        }
    } else {
        throw new Exception("The " . $route_parts["controller"] . " controller does not exist", 500);
    }
开发者ID:jeffreytierney,项目名称:mobileswitchcomb,代码行数:31,代码来源:index.php

示例7: goHome

 public function goHome()
 {
     SC::transfer();
 }
开发者ID:jeffreytierney,项目名称:switchcomb,代码行数:4,代码来源:SCUser.php

示例8: handleException

 static function handleException($ex)
 {
     $code = $ex->getCode() or $code = 400;
     if (in_array($code, array(401, 403))) {
         SC::transfer();
     } else {
         header($ex->getMessage(), true, $code);
         die($ex->getMessage());
     }
 }
开发者ID:jeffreytierney,项目名称:switchcomb,代码行数:10,代码来源:SC.php


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