本文整理匯總了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");
}
示例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');
}
示例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();
}
示例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();
}
示例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';
}
}
}
示例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';
示例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) {
示例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';
?>
示例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');
}
示例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');
}
示例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');
}
示例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';
示例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/>
示例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">
示例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());
}
}