本文整理汇总了PHP中helpers\Url::previous方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::previous方法的具体用法?PHP Url::previous怎么用?PHP Url::previous使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers\Url
的用法示例。
在下文中一共展示了Url::previous方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: status
public function status($parameter)
{
$type = $parameter[0];
$id = $parameter[1];
if ($type == 'deactivate') {
$update_user = $this->user_model->updateId(array('user_status_id' => Status::id('inactive')), $id);
} else {
$update_user = $this->user_model->updateId(array('user_status_id' => Status::id('active')), $id);
}
if (isset($update_user)) {
Session::set('success', 'status changed!');
} else {
Session::set('error', 'operation fails');
}
Url::previous();
}
示例2: delete
public function delete($parameter)
{
$item_id = $parameter[0];
$category_model = new \Models\Category();
$delete = $category_model->deleteId($item_id);
if (isset($delete)) {
Session::set('success', 'record deleted');
Url::previous();
}
}
示例3: feature
public function feature($parameter)
{
$action = $parameter[0];
$id = $parameter[1];
$model = new \Models\Song();
$status_model = new \models\status();
switch ($action) {
case 'unfeature':
$update = $model->updateId(array('media_featured' => 0), $id);
break;
case 'feature':
$update = $model->updateId(array('media_featured' => 1), $id);
break;
case 'singlefeature':
$update = $model->updateId(array('media_featured' => 2), $id);
break;
default:
# code...
break;
}
if ($update > 0) {
Session::set('success', 'video featured!');
} else {
Session::set('error', 'operation fails!');
}
Url::previous();
}
示例4: delete
public function delete($param)
{
// $type = $param[0];
$delete_id = $param[0];
// if($type == 'page')
$delete = $this->pageModel->deleteId($delete_id);
// else
// $delete = $this->contentModel->delete(array('content_page_id'=>$delete_id));
if ($delete > 0) {
Session::set('success', 'Record Deleted!');
} else {
Session::set('error', 'Delete Fails!');
}
Url::previous();
}
示例5: logout
public function logout()
{
Session::destroy();
setcookie('rememberme', false, time() - 3600 * 3650);
//'/', COOKIE_DOMAIN);
Url::previous();
}
示例6: ajoutalbum
public function ajoutalbum()
{
if (isset($_POST['nom']) && Session::get('id') != null) {
$_POST = Gump::sanitize($_POST);
$a = new Album($_POST['nom'], Session::get('id'));
EntityManager::getInstance()->save($a);
}
Url::previous();
}
示例7: user
public function user($id)
{
// Check for orderby selection
$data['orderby'] = Request::post('orderby');
// Get data for users
$data['current_page'] = $_SERVER['REQUEST_URI'];
$data['title'] = "User";
$data['welcome_message'] = "Welcome to the User Admin Panel";
$data['csrf_token'] = Csrf::makeToken();
// Get user groups data
$data_groups = $this->model->getAllGroups();
// Get groups user is and is not member of
foreach ($data_groups as $value) {
$data_user_groups = $this->model->checkUserGroup($id, $value->groupID);
if ($data_user_groups) {
$group_member[] = $value->groupID;
} else {
$group_not_member[] = $value->groupID;
}
}
// Gether group data for group user is member of
if (isset($group_member)) {
foreach ($group_member as $value) {
$group_member_data[] = $this->model->getGroupData($value);
}
}
// Push group data to view
$data['user_member_groups'] = $group_member_data;
// Gether group data for group user is not member of
if (isset($group_not_member)) {
foreach ($group_not_member as $value) {
$group_notmember_data[] = $this->model->getGroupData($value);
}
}
// Push group data to view
$data['user_notmember_groups'] = $group_notmember_data;
// Check to make sure admin is trying to update user profile
if (isset($_POST['submit'])) {
// Check to make sure the csrf token is good
if (Csrf::isTokenValid()) {
if ($_POST['update_profile'] == "true") {
// Catch password inputs using the Request helper
$au_id = Request::post('au_id');
$au_username = Request::post('au_username');
$au_email = Request::post('au_email');
$au_firstName = Request::post('au_firstName');
$au_gender = Request::post('au_gender');
$au_website = Request::post('au_website');
$au_userImage = Request::post('au_userImage');
$au_aboutme = Request::post('au_aboutme');
// Run the update profile script
if ($this->model->updateProfile($au_id, $au_username, $au_firstName, $au_email, $au_gender, $au_website, $au_userImage, $au_aboutme)) {
// Success
$success[] = "You Have Successfully Updated User Profile";
} else {
// Fail
$error[] = "Profile Update Failed";
}
}
// Check to see if admin is removing user from group
if ($_POST['remove_group'] == "true") {
// Get data from post
$au_userID = Request::post('au_userID');
$au_groupID = Request::post('au_groupID');
// Updates current user's group
if ($this->model->removeFromGroup($au_userID, $au_groupID)) {
// Success
$success[] = "You Have Successfully Removed User From Group";
\Helpers\Url::previous();
} else {
// Fail
$error[] = "Remove From Group Failed";
}
}
// Check to see if admin is adding user to group
if ($_POST['add_group'] == "true") {
// Get data from post
$au_userID = Request::post('au_userID');
$au_groupID = Request::post('au_groupID');
// Updates current user's group
if ($this->model->addToGroup($au_userID, $au_groupID)) {
// Success
$success[] = "You Have Successfully Added User to Group";
\Helpers\Url::previous();
} else {
// Fail
$error[] = "Add to Group Failed";
}
}
// Check to see if admin wants to activate user
if ($_POST['activate_user'] == "true") {
$au_id = Request::post('au_id');
// Run the Activation script
if ($this->model->activateUser($au_id)) {
// Success
$success[] = "You Have Successfully Activated User";
\Helpers\Url::previous();
} else {
// Fail
$error[] = "Activate User Failed";
//.........这里部分代码省略.........