saimcan
saimcan

Reputation: 1762

How to change laravel route links

Okay i got a link from following codes like :

www.mysite.com/public/myRoute?id=11223355

But, i want to change id section of my link. How can i do that ?

Route here:

Route::get('myRoute', array(
    'uses' => 'myController@myRoute',
    'as' => 'myRoute'
));

Controller here :

class myController extends BaseController{
   public function myRoute(){
      return View::make('pages.myPage');
   }
}

home.blade.php here :

{{ HTML::linkRoute('myRoute', 'myLink' , array('id' => '11223355'), array('class' => 'text text-center')) }}

Upvotes: 0

Views: 260

Answers (1)

rdiz
rdiz

Reputation: 6176

Route::get('myRoute/{id}', array(
    'uses' => 'myController@myRoute',
    'as' => 'myRoute'
));


class myController extends BaseController{
   public function myRoute($id){
      return View::make('pages.myPage');
   }
}

{{ HTML::linkRoute('myRoute', 'myLink' , array('11223355'), array('class' => 'text text-center')) }}

Upvotes: 2

Related Questions