F3: Rerouting to a dynamic URL

38 views
Skip to first unread message

Kami Barut

unread,
May 25, 2017, 3:27:47 PM5/25/17
to Fat-Free Framework
Hi,

I am having some difficulties rerouting to a dynamic URL from within my controller.

; in routes.ini

GET /admin/profiles/patient/@patientId/insert-report = Admin->createReport

// in the controller Admin.php, in method createReport():

.....

$patientId = $f3->get('PARAMS.patientId');

......

// My attempt later in method createReport():

$f3->reroute('admin/profiles/patient/' . echo (string)$patientId . '/insert-report');

Question: How to reroute to the same URL (where some error messages will be displayed) without
changing completely the routing, that is attaching patientId as URL query parameter ?

Thanks,

K.

ved

unread,
May 25, 2017, 4:01:15 PM5/25/17
to Fat-Free Framework
// My attempt later in method createReport():

$f3->reroute('admin/profiles/patient/' . echo (string)$patientId . '/insert-report');


This should probably be:

$f3->reroute('/admin/profiles/patient/' . (string)$patientId . '/insert-report');

 
Reply all
Reply to author
Forward
0 new messages