本文整理汇总了PHP中Redirect::Action方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::Action方法的具体用法?PHP Redirect::Action怎么用?PHP Redirect::Action使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redirect
的用法示例。
在下文中一共展示了Redirect::Action方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
if (ACL::checkUserPermission('permission.show') == false) {
return Redirect::action('dashboard');
}
$title = Lang::get('Permission Info');
$permissionInfo = Permission::find($id);
if (!empty($permissionInfo)) {
return View::make('permission/show', array('permissionInfo' => $permissionInfo, 'title' => $title));
} else {
$message = 'Cannot find Permission Info';
return Redirect::Action('settings.permission')->with('error', $message);
}
}
示例2: process
/**
* Process the contact us form data
*
* @return \Illuminate\Support\Facades\Redirect
*/
public function process()
{
$rules = ['first_name' => 'required', 'last_name' => 'required', 'company' => '', 'email' => 'required|email', 'phone' => '', 'message_body' => 'required'];
$data = \Input::only('first_name', 'last_name', 'email', 'company', 'phone', 'message_body');
$validator = \Validator::make($data, $rules);
if ($validator->fails()) {
return \Redirect::Action('ContactController@index')->withErrors($validator)->withInput();
}
//-- Save to database incase email is lost, or fails
$contact = \Contact::create($data);
\Mail::send('emails.contact', $data, function ($message) {
$message->to('john.doe@email.com', 'John Doe')->subject('Welcome!');
});
return \Redirect::Action('ContactController@thankYou');
}
示例3: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
if (ACL::checkUserPermission('player.edit') == false) {
return Redirect::action('dashboard');
}
$player_info = User::find($id);
if (!empty($player_info)) {
$title = Lang::get('Edit Player Details');
$form_open = Form::open(array('method' => 'put', 'id' => 'form-player', 'class' => 'smart-form', 'route' => array('player.update', $id)));
$form_close = Form::close();
$data = array('form_open' => $form_open, 'form_close' => $form_close, 'title' => $title, 'url_rfid' => URL::route('player.rfid'), 'player_info' => $player_info);
return View::make('player/edit', $data);
} else {
$message = 'Cannot get player info. Please try again.';
return Redirect::Action('player.index')->with('error', $message);
}
}
示例4: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
if (ACL::checkUserPermission('user.show') == false) {
return Redirect::action('dashboard');
}
$title = Lang::get('User Info');
$userInfo = User::find($id);
$userMember = UserMember::with('group')->where('user_id', $id)->get();
$userAccess = ACL::checkPermission($id);
if (!empty($userInfo)) {
return View::make('user/show', array('userInfo' => $userInfo, 'userMember' => $userMember, 'userAccess' => $userAccess['access'], 'title' => $title));
} else {
$message = 'Cannot find User Info';
return Redirect::Action('settings.user')->with('error', $message);
}
}