1-Route
Basit Rotalama şu şekilde yapılır
http://domain.com/sayfa
//views klasörünün altında gidileceksayfa.php sayfamıza yönlendiriyor
http://domain.com/sayfa
1 <?php
2
3 // app/routes.php
4
5 Route::get('/sayfa', function() {
6 return 'Merhaba dünya!';
7 }); 
Bunun yerine bir sayfaya yönlendirme yapmak için
1 <?php
2
3 // app/routes.php
4
5 Route::get('/', function()
6 {
7 return View::make('gidileceksayfa'); 
8 });
//views klasörünün altında gidileceksayfa.php sayfamıza yönlendiriyor
routenin metodları:
1 <?php 2 3 // app/routes.php 4 5 Route::get(); 6 Route::post(); 7 Route::put(); 8 Route::delete(); 9 Route::any();
şeklinde metodlar da mevcuttur
Comments
Post a Comment