當前位置: 首頁>>代碼示例>>PHP>>正文


PHP session::flash方法代碼示例

本文整理匯總了PHP中session::flash方法的典型用法代碼示例。如果您正苦於以下問題:PHP session::flash方法的具體用法?PHP session::flash怎麽用?PHP session::flash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在session的用法示例。


在下文中一共展示了session::flash方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 public function index()
 {
     $cvId = DB::table('CV')->where('employeeId', \Session::get('employeeId'))->select('employeeId')->get();
     if ($cvId) {
         \session::flash('cvId', $cvId);
     }
     return \View::make("index");
 }
開發者ID:buraksecer,項目名稱:kariyer-portal,代碼行數:8,代碼來源:IndexController.php

示例2: habilitarupdate

 public function habilitarupdate(Request $request)
 {
     $habilitar = HabilitarEvaluacion::find(1);
     $habilitar->fill($request->only(['estado']));
     $habilitar->save();
     session::flash('message', 'Evaluacion editada');
     //,array($bios->id)
     return redirect()->route('evaluacion.index');
 }
開發者ID:naziio,項目名稱:Crossfitpocurotitulo2,代碼行數:9,代碼來源:EvaluacionController.php

示例3: removeGateway

 public function removeGateway($id)
 {
     if (!\Auth::user()->isAdmin()) {
         return back()->withErrors(['You have no permissions to remove gateway.']);
     }
     $gateway = Gateway::findOrFail($id);
     $gateway->delete();
     session::flash('message', 'Gateway removed.');
     return back();
 }
開發者ID:ptrstovka,項目名稱:sms-gateway,代碼行數:10,代碼來源:GatewayController.php

示例4: initFlash

	/**
	 * Init the flash instance
	 */
	public static function initFlash() {
		if (self::$flash)
			return;

		self::$flash = self::getInstance(array(
			'prefix'=>'flash',
			'nameSpace'=>'flash',
		));

		self::$flashVars = self::$flash->getAll();
		self::$flash->clear();
	}
開發者ID:nyroDev,項目名稱:nyroFwk,代碼行數:15,代碼來源:session.class.php

示例5: activate

 /**
  * Alert Activate function
  * 
  * Triggers the alert box if a session is set on alert
  */
 public static function activate()
 {
     if (Session::exists('alert')) {
         $alertRawData = session::flash('alert');
         $alertData = explode(',', $alertRawData);
         if (count($alertData) === 3) {
             $data['eventType'] = $alertData[0];
             $data['alertTitle'] = $alertData[1];
             $data['alertMessage'] = $alertData[2];
             require_once APPPATH . 'views/alerts/alertMain.html.php';
         }
     }
 }
開發者ID:mdb-webdev,項目名稱:techstream-v3,代碼行數:18,代碼來源:Alerts.php

示例6: user

require_once '/opt/lampp/htdocs/MySpace/src/init.php';
$user = new user();
//echo $user->data()->node_id;
if (!$user->isLoggedIn()) {
    redirect::to('index.php');
}
if (input::exists()) {
    if (token::check(input::get('token'))) {
        //echo $user->data()->node_id;
        $validate = new validation();
        $validation = $validate->check($_POST, array('FirstName' => array('required' => true, 'min' => 2, 'max' => 20), 'LastName' => array('required' => true, 'min' => 2, 'max' => 20), 'CurrentTown' => array('required' => true, 'min' => 2, 'max' => 20), 'Hometown' => array('required' => true, 'min' => 2, 'max' => 20)));
        if ($validation->passed()) {
            try {
                $user->update(array('FirstName' => input::get('FirstName'), 'LastName' => input::get('LastName'), 'CurrentTown' => input::get('CurrentTown'), 'Hometown' => input::get('Hometown')));
                session::flash('home', 'Your details have been updated!!');
                redirect::to('index.php');
            } catch (Exception $e) {
                die($e->getMessage());
            }
        } else {
            foreach ($validation->errors() as $error) {
                echo $error, '<br>';
            }
        }
    }
}
?>
<!DOCTYPE Funspecified PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<link href="<?php 
echo 'register.css';
開發者ID:pediredla,項目名稱:SocialNetwork,代碼行數:30,代碼來源:update.php

示例7: escape

                        echo escape($comment[1]->CommentedBy);
                        ?>
"><?php 
                        echo escape($comment[1]->CommentedBy);
                        ?>
</a>

<?php 
                    }
                }
            }
            if (input::exists()) {
                $comment = input::get('text' . $post->PostID);
                if ($comment != null) {
                    if ($user->WrtieComment($user->data()->UserID, $post->PostID, $comment)) {
                        session::flash('home', 'Comment added');
                        redirect::to('index.php');
                    }
                }
                $like = input::get('like' . $post->PostID);
                if ($user->Like($user->data()->UserID, $post->PostID)) {
                    //session::flash ( 'home', 'Post liked!' );
                    redirect::to('index.php');
                }
            }
        }
        ?>
<p>Special Query to see list of comments you've commented</p>
<?php 
        if ($user->SpecialQuery($user->data()->UserID)) {
            foreach ($user->special1() as $special) {
開發者ID:pediredla,項目名稱:SocialNetwork,代碼行數:31,代碼來源:index.php

示例8: Validation

    if (!$user2->exist()) {
        session::flash('error', 'The user does not exist!');
        Redirect::to(path . 'index.php');
    }
}
if (Input::exists()) {
    if (Token::check(Input::get('token'))) {
        $validate = new Validation();
        $validate->check($_POST, array('id' => array('required' => true), 'name' => array('required' => true), 'username' => array('required' => true, 'min' => 2, 'max' => 15), 'group' => array('required' => true)));
        if ($validate->passed()) {
            try {
                $user2->update(Input::get('name'), Input::get('group'), Input::get('username'), Input::get('id'));
                session::flash('complete', 'You updated ' . Input::get('name') . ' details!');
                Redirect::to(path . 'index.php');
            } catch (Exception $e) {
                session::flash('error', 'There was an error updating the user ' . Input::get('name') . ' with the message of ' . $e->getMessage() . '(' . $e->getCode() . ')');
            }
        }
    }
}
?>
<html>
	<head>
		<?php 
include path . 'assets/php/css.php';
?>
	</head>
	<body>
		<?php 
include path . 'assets/php/nav.php';
?>
開發者ID:Root3287,項目名稱:PHP-Blog,代碼行數:31,代碼來源:editUser.php

示例9: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $subirwod = SubirWod::findOrFail($id);
     $subirwod->delete();
     session::flash('message', ' eliminado de los registros');
     return redirect()->route('admin.subirwod.index');
 }
開發者ID:naziio,項目名稱:Crossfitpocurotitulo2,代碼行數:13,代碼來源:SubirWodController.php

示例10: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id, Request $request)
 {
     $users = User::findOrFail($id);
     $users->delete();
     session::flash('message', 'Usuario eliminado de los registros');
     return redirect()->route('admin.users.index');
 }
開發者ID:naziio,項目名稱:Crossfitpocurotitulo2,代碼行數:13,代碼來源:BioUserController.php

示例11: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $woddiario = WodDiario::findOrfail($id);
     $woddiario->delete();
     session::flash('message', 'WOD eliminado');
     return redirect()->route('admin.woddiario.index');
 }
開發者ID:naziio,項目名稱:Crossfitpocurotitulo2,代碼行數:13,代碼來源:WodDiarioController.php

示例12: Validation

    if (Token::check(Input::get('token'))) {
        $val = new Validation();
        $val->check($_POST, array('name' => array('required' => true), 'username' => array('required' => true, 'min' => 2, 'max' => 50, 'unique' => 'users'), 'email' => array('required' => true, 'unique' => 'users'), 'password' => array('required' => true, 'min' => 8), 'password_conf' => array('required' => true, 'matches' => 'password')));
        if (!$val->passed()) {
        } else {
            $user = new User();
            $salt = hash::salt(32);
            $password = hash::make(escape(Input::get('password')), $salt);
            try {
                $user->create(array('username' => escape(Input::get('username')), 'password' => Hash::make(escape(Input::get('password')), $salt), 'salt' => $salt, 'name' => escape(Input::get('name')), 'joined' => date('Y-m-d- H:i:s'), 'group' => 1, 'email' => escape(Input::get('email'))));
            } catch (Exception $e) {
                die($e->getMessage());
            }
            if ($user->login(escape(Input::get('username')), escape(Input::get('password')), false)) {
                Notifaction::createMessage('Welcome to the forums ' . $user->data()->name, $user->data()->id);
                session::flash('complete', 'You completely register and you just got logged in.');
                Redirect::to('/');
            }
        }
    }
}
?>
<html>
	<head>
	<?php 
include 'inc/templates/head.php';
?>
	</head>
	<body>
		<?php 
include 'inc/templates/nav.php';
開發者ID:Root3287,項目名稱:PHP-Forums,代碼行數:31,代碼來源:register.php

示例13: user

require_once '/opt/lampp/htdocs/MySpace/src/init.php';
$user = new user();
if (!$user->isLoggedIn()) {
    redirect::to('index.php');
}
if (input::exists()) {
    if (token::check(input::get('token'))) {
        $validate = new validation();
        $validation = $validate->check($_POST, array('Password' => array('required' => true, 'min' => 8), 'Npassword' => array('required' => true, 'min' => 8), 'Rpassword' => array('required' => true, 'min' => 8, 'matches' => 'Npassword')));
        if ($validation->passed()) {
            if (hash::make(input::get('Password')) !== $user->data()->Password) {
                echo 'your old password did not match';
            } else {
                if ($user->update(array('Password' => hash::make(input::get('Npassword'))))) {
                    session::flash('home', 'Your password have been updated!!');
                    redirect::to('index.php');
                }
            }
        }
    }
}
?>
<link href="<?php 
echo 'register.css';
?>
" rel='stylesheet' type='text/css'>
<form action="" method="post">
  <div class="field">
  <label id="icon" for="Password"><i class="icon-shield"></i></label>
 		<input type="Password" name="Password" id="Password" placeholder="CurrentPassword" required/>
開發者ID:pediredla,項目名稱:SocialNetwork,代碼行數:30,代碼來源:changepassword.php

示例14: Validation

<?php

if (Input::exists()) {
    if (Token::check(Input::get('token'))) {
        $val = new Validation();
        $validation = $val->check($_POST, array('oldPassword' => array('required' => true), 'newPassword' => array('required' => true, 'min' => 8), 'password_conf' => array('required' => true, 'matches' => 'newPassword')));
        if ($validation->passed()) {
            if (Hash::make(escape(Input::get('oldPassword')), $user->data()->salt) == $user->data()->password) {
            }
            $newPass = Hash::make(escape(Input::get('newPassword')), $user->data()->salt);
            try {
                $user->update(array('password' => $newPass), $user->data()->id);
                session::flash('complete', 'You have changed your password!');
                Redirect::to('');
            } catch (Exception $e) {
                Session::flash('error', $e->getMessage());
                Redirect::to('');
            }
        }
    }
}
?>
<form action="" method="post">
	<div class="form-group">
		<input type="password" name="oldPassword" placeholder="Old Password" class="form-control input-lg">
	</div>
	<div class="form-group">
		<input type="password" name="newPassword" placeholder="New Password" class="form-control input-lg">
	</div>
	<div class="form-group">
		<input type="password" name="password_conf" placeholder="Password Confirm" class="form-control input-lg">
開發者ID:Root3287,項目名稱:PHP-Grade,代碼行數:31,代碼來源:change_password.php

示例15: validate

 $validate = new validate();
 $validation = $validate->check($_POST, array('Password' => array('required' => true, 'min' => 6), 'password_again' => array('required' => true, 'matches' => 'Password')));
 if ($validation->passed()) {
     //session::flash('success','You registered successfully!');
     //header('Location: index.php');
     $user = new user(null, $_log);
     $salt = hash::salt(32);
     if ($data = $_db->get('Users', array('Username', '=', $username))) {
         //var_dump($data);
         if ($data->counts() > 0) {
             if ($data->first()->User_Verified == 0) {
                 if ($data->first()->Confirm_Hash == $confirmCode) {
                     $oldUser = $data->first()->Old_User;
                     try {
                         $user->updateUser(array('Password' => hash::make(input::get('Password'), $salt), 'Salt' => $salt, 'User_Verified' => 1, 'Confirm_Hash' => null, 'Old_User' => null), $_GET['Username']);
                         session::flash('home', 'Your password has been created');
                         $_log->info('Username verified: ' . $username);
                         // Will be logged
                         if ($oldUser !== null) {
                             try {
                                 if ($user->delete($oldUser)) {
                                     $_log->info('Old user deleted: ' . (string) $oldUser);
                                 } else {
                                     $_log->warning('Old user NOT deleted: ' . (string) $oldUser);
                                 }
                             } catch (Exception $e) {
                                 var_dump($e->getMessage());
                                 $_log->info($e->getMessage());
                                 die($e->getMessage());
                             }
                         }
開發者ID:jdupreez1,項目名稱:smartpoint,代碼行數:31,代碼來源:emailVerify.php


注:本文中的session::flash方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。