flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.63k stars 407 forks source link

How to use a Get function ? #464

Closed Flashtheorie closed 2 years ago

Flashtheorie commented 2 years ago

Hello, I'm trying to redirect the user on his profile using:

/user/hisname

So I tried to use

Flight::route('GET /user/@name', function($name){ include 'views/profil.php?user='.$name; });

But it shows an error 500, how am I supposed to use it ?

Thank you

Flashtheorie commented 2 years ago

Nevermind, I found it myself

Flight::route('GET /user/@name', function($name){ $_GET['id'] = $name; include 'views/index.php'; });