It is possible to pass parameter to the page using controller via ->with() for example
public function two(){
return View::make('page2')->with('id', 2);
}
and now $id can be accessible in page2.blade.php
But i want to pass parameters via url with array like the way below
routes.php
<?php
Route::get('page1',
array(
'uses' => 'pagecontroller@page1'
));
Route::get('page2/{$id}',
array(
'uses'=>'pagecontroller@page2'
));
pagecontroller.php
<?php
class pagecontroller extends BaseController{
public function page1(){
return View::make('page1');
}
public function page2($id){
return "ID : $id";
}
page1.blade.php
<p>This Is Page1</p>
<a href="{{action('pagecontroller@page2', array('id'=>1) )}}">Page2</a>
And it is showing the error : Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
Where is it going wrong?