0
컨트롤러에 내 양식 데이터를 저장하고 해당 데이터를 저장 한 후 내 페이지를 다른 양식으로 리디렉션하려고합니다. 그러나 리디렉션 부분이 작동하지 않습니다. 이것은 내 저축 컨트롤러 코드입니다. laravel 4에서 다른 컨트롤러에서 컨트롤러 호출하기
class CompanyRegistrationController extends BaseController { public function saveAndCreateCompany() { // my code which gets form data and saves in database. //After that i am trying to redirect this to another page. To acheive this i am trying to do this. App::make('AddMoreEmployeeController')->showAddMoreEmployeeDetails(); } } // My new page code class AddMoreEmployeeController extends BaseController { public function showAddMoreEmployeeDetails() { return View::make('company.addEmployee'); } } Routes.php code Route::post('/companyCreatedSuccessfully', array('uses' => '[email protected]','as' => 'saveAndCreateCompany')); Route::get('/addMoreEmployeeDetails', array('uses' => '[email protected]','as' => 'showAddMoreEmployeeDetails'));그러나 양식 세부 정보를 채운 후 "addMoreEmployeeDetails"로 리디렉션하지 않습니다. 아직 공백 page.But에 성공적으로 companyCreatedSuccessfully에있어 데이터베이스에 성공적으로 데이터를 저장 한 후 addMoreEmployeeDetails로 리디렉션해야합니다. 내가 실수 한 곳은 어디입니까?
예, 내가 이런 짓을 지금 내게 그것을 위해 새 페이지가 표시됩니다. 그러나 url은 chnaging하지 않습니다. 여전히/companyCreatedSuccessfully를 보여줍니다. 하지만 난/addMoreEmployee이 URL을 추가해야합니다. – user3408779
@ user3408779 내 대답을 편집했습니다 –
고마워,이 나를 위해 작동합니다. :) – user3408779