本文整理汇总了PHP中Session::flash方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::flash方法的具体用法?PHP Session::flash怎么用?PHP Session::flash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session
的用法示例。
在下文中一共展示了Session::flash方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testFlash
/**
* @covers $this->object->flash
*/
public function testFlash()
{
$this->object->flash('test', 'Trixie');
$this->object->flash('test', 'Tinkerbell');
$this->assertEquals('Tinkerbell', $this->object->flash('test'));
$this->assertEquals(null, $this->object->flash('test'));
}
示例2: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(Request $request)
{
$this->validate($request, ['razonsocial' => 'required', 'numero' => 'required|unique:cuits,numero']);
Cuit::create($request->all());
\Session::flash('message', 'Cuit added!');
return redirect('cuits');
}
示例3: getLogout
/**
* Log the user out of the application.
*
* @return \Illuminate\Http\Response
*/
public function getLogout()
{
$user = \Auth::user()->name;
\Auth::logout();
\Session::flash('flash_message', $user . ': You have been logged out.');
return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
}
示例4: index
/**
* Show the application dashboard to the user.
*
* @return Response
*/
public function index()
{
if (\Auth::user()->status != 1) {
\Session::flash('message', 'You are Blocked by Admin');
}
return view('home');
}
示例5: archive
public function archive($publicId)
{
$branch = Branch::scope($publicId)->firstOrFail();
$branch->delete();
Session::flash('message', trans('texts.archived_branch'));
return Redirect::to('company/branches');
}
示例6: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
$account = new Account();
$account->setDomain(Input::get('domain'));
$account->setNit(Input::get('nit'));
$account->setName(Input::get('name'));
$account->setEmail(Input::get('email'));
// return $account->getErrorMessage();
if ($account->Guardar()) {
//redireccionar con el mensaje a la siguiente vista
Session::flash('mensaje', $account->getErrorMessage());
$direccion = "http://" . $account->domain . ".emizor.com";
//enviando correo de bienvenida
global $correo;
$correo = $account->getEmail();
// return Response::json($correo);
Mail::send('emails.bienvenida', array('direccion' => $direccion, 'name' => $account->getName(), 'nit' => $account->getNit()), function ($message) {
global $correo;
$message->to($correo, '')->subject('Emizor');
});
//
// $direccion = "/crear/sucursal";
return Redirect::to($direccion);
}
Session::flash('error', $account->getErrorMessage());
return Redirect::to('crear');
}
示例7: getPage
public function getPage($section = false, $page = false)
{
if ($section === false || $page === false) {
return Redirect::to('/' . getLang());
}
$this->loadQuestions();
if (!isset($this->quiz[$section]['pages']['page' . $page])) {
return Redirect::to('/' . getLang());
}
if ($section != 'demographics' && $this->screenersAnswered == false) {
\Session::flash('flash_message', 'Please complete the "Demographics" section before continuing');
return Redirect::to('/quiz/demographics/' . $this->screenerToAnswer);
}
$data = $this->quiz[$section];
$sectionQuestions = $data['pages']['page' . $page];
$script = false;
foreach ($sectionQuestions['questions'] as $number => $question) {
if (isset($question['script'])) {
$script[] = $question['script'];
}
}
$currentLocal = App::getLocale();
$localQuestions = $currentLocal == 'en' ? '' : $currentLocal;
$btnsize = '-small';
if ($localQuestions == 'es') {
$btnsize = '-small lang';
}
$vars = array('questions' => $sectionQuestions['questions'], 'heading' => Lang::get('general.title'), 'title' => $data['title'], 'report' => false, 'menu' => $this->menu, 'progress' => $this->totAnswered > 0 ? floor($this->totAnswered / $this->totQuestions * 100) : 0, 'colour' => $data['colour'], 'section' => $section, 'page' => $page, 'script' => $script, 'btnsize' => $btnsize);
return View::make('question', $vars);
//return $vars['questions'];
//return $this->quiz;
}
示例8: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
$familia = Familia::findOrFail($id);
$validator = Familia::validator(Input::all());
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
}
$datos = Input::all();
if (Input::file('foto')) {
$file = Input::file('foto');
$destinationPath = 'uploads/images/';
$filename = Str::random(20) . '.' . $file->getClientOriginalExtension();
$mimeType = $file->getMimeType();
$extension = $file->getClientOriginalExtension();
$upload_success = $file->move($destinationPath, $filename);
if ($familia->foto != 'fam.jpg') {
File::delete($destinationPath . $familia->foto);
}
$datos['foto'] = $filename;
} else {
unset($datos['foto']);
}
$familia->update($datos);
Session::flash('message', 'Actualizado Correctamente');
Session::flash('class', 'success');
return Redirect::to('/dashboard/familia');
}
示例9: store
/**
* Store a newly created resource in storage.
* POST /invoice
*
* @return Response
*/
public function store()
{
$validator = Validator::make(Input::all(), Invoice::$rules);
if ($validator->fails()) {
return Redirect::to('invoice')->withErrors($validator)->withInput(Input::all());
} else {
$invoice = new Invoice();
$invoice->no_inv = Input::get('no_inv');
$invoice->tgl_inv = Input::get('tgl_inv');
$invoice->no_PO = Input::get('no_PO');
$invoice->ship_by = Input::get('ship_by');
$invoice->pay_method = Input::get('pay_method');
$invoice->no_rek = Input::get('no_rek');
$invoice->pelabuhan = Input::get('pelabuhan');
$invoice->carrier = Input::get('carrier');
$invoice->save();
$SPPB = Barang::join('detil_SPPB', 'barang.kode_barang', '=', 'detil_SPPB.kode_barang')->join('SPPB', 'detil_SPPB.no_SPPB', '=', 'SPPB.no_SPPB')->join('PO', 'SPPB.no_SPPB', '=', 'PO.no_SPPB')->where('no_PO', Input::get('no_PO'))->selectRaw('barang.kode_barang as barang, jml_pesan as pesan')->get();
foreach ($SPPB as $key => $value) {
$barang = Barang::find($value->barang);
$barang->jml_barang = $barang->jml_barang - $value->pesan;
$barang->save();
}
Session::flash('message', 'Successfully created invoice!');
return Redirect::to('invoice');
}
}
示例10: getDelete
public function getDelete($id)
{
$guest = guest::find($id);
$guest->delete();
Session::flash('message', 'The records are deleted successfully');
return Redirect::to('guest');
}
示例11: destroy
public function destroy($id)
{
$ac = Activity::find($id);
$ac->delete();
Session::flash('success', 'Data telah dihapus.');
return Redirect::to('/' . Auth::user()->role . '/activity');
}
示例12: destroy
public function destroy($id)
{
$bantek = Bantek::find($id);
$bantek->delete();
Session::flash('success', 'Data telah dihapus');
return Redirect::to('admin/bantek');
}
示例13: getDelete
public function getDelete($id)
{
$regions = Regions::find($id);
$regions->delete();
Session::flash('message', 'The records are deleted successfully');
return Redirect::to('regions');
}
示例14: register
/**
* POST /register
*
* @return \View
* @throws \Report\Managers\ValidationException
*/
public function register()
{
$manager = new RegisterManager($this->userRepo->newUser(), Input::all());
$manager->save();
Session::flash('message', 'register-sucess');
return Redirect::route('sing-in');
}
示例15: update
public function update($id)
{
$data = Setting::find($id);
$data->email_sender = Input::get('email');
$data->protokol = Input::get('protokol');
$data->port = Input::get('port');
$data->host = Input::get('host');
$data->user_email = Input::get('user');
$data->pass_email = Input::get('pass');
$data->save();
if ($data->save()) {
Session::flash('messages', '
<div class="alert alert-info alert-dismissable" id="notif">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<strong>Keterangan</strong><br>
Setting berhasil disimpan
</div>
');
} else {
Session::flash('messages', '
<div class="alert alert-danger alert-dismissable" id="notif">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<strong>Peringatan...</strong><br>
Settig gagal disimpan
</div>
');
}
return Redirect::to('admin/setting/email');
}