Search code examples
phpfat-free-framework

Fat Free Framework Routing System causes unexpected behavior


my routing code:

F3::route('GET  @root: /', "\\Controller\\_App\\App_navigation->get_delegator");

F3::route('GET  @modul: /@module', "\\Controller\\@module->get_index");
F3::route('POST @modul',           "\\Controller\\@module->post_index");
F3::route('GET  @proses: /@module/@proc.ksd', "\\Controller\\@module->get_@proc");
F3::route('POST @proses',                     "\\Controller\\@module->post_@proc");


F3::route('GET  @submodul: /@module/@submodule', "\\Controller\\@module\\@submodule->get_index");
F3::route('POST @submodul',                      "\\Controller\\@module\\@submodule->post_index");

F3::route('GET  @proses2: /@module/@submodule/@proc.ksd', "\\Controller\\@module\\@submodule->get_@proc");
F3::route('POST @proses2',                                "\\Controller\\@module\\@submodule->post_@proc");

i was trying to access the proses route, and it's didn't match any. is this a unexpected behavior?

it's working when i disable the submodul and proses2 routing name.

here's the screen shoot: 101 debugging mode~

how to resolve this?


Solution

  • Actually, you've hit a bug: /@module/@submodule took precedence order over /@module/@proc.ksd while it shouldn't.

    If you download the latest base.php from the edge repository, your issue should be fixed.