本文整理汇总了PHP中SC::setFlashMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP SC::setFlashMessage方法的具体用法?PHP SC::setFlashMessage怎么用?PHP SC::setFlashMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC
的用法示例。
在下文中一共展示了SC::setFlashMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
public function create()
{
try {
$api = new SCApi();
$user = $api->users_create();
SC::checkRedir(SCRoutes::set("users", "memberships_index", array("userid" => $user->userid)));
} catch (Exception $ex) {
SC::setFlashMessage($ex->getMessage(), "error");
$this->_new();
}
}
示例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();
}
}
示例3: create
public function create()
{
try {
$api = new SCApi();
$user = $api->usersessions_create();
if ($user) {
// see if there is a redir sessions var set and if so go there
// if not go home
SC::checkRedir();
}
} catch (Exception $ex) {
SC::setFlashMessage($ex->getMessage(), "error");
SC::transfer();
}
}
示例4: 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);
}
}
示例5: 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();
}
}
}