Skip to content

Working router functionality. Needs testing#5

Open
aleksanderakero wants to merge 1 commit intomasterfrom
php-core_router
Open

Working router functionality. Needs testing#5
aleksanderakero wants to merge 1 commit intomasterfrom
php-core_router

Conversation

@aleksanderakero
Copy link
Collaborator

No description provided.

@Dalisra
Copy link
Owner

Dalisra commented Jun 8, 2016

"authorize/login", "/login/test" => "autorize/logintest", "/logout/" => "authorize/logout" ); $allowDynamicUrls = true; $case0Url = "/admin"; // admin/process $case1Url = "/login"; // authorize/login $case2Url = "/login/test"; // authorize/logintest $case3Url = "/login/blabla"; // authorize/login $case4Url = "/login/blabla/hackingthis/shit"; // authorize/login ## 1. Full Match $url = $routes[$case1Url]; // -> OK $url = $routes[$case2Url]; // -> OK $url = $routes[$case3Url]; // -> FAIL $url = $routes[$case4Url]; // -> FAIL ## 2. If Failed $case3Url = $case3Url - ["last_url_part"]; // -> /login $case4Url = $case4Url - ["last_url_part"]; // -> /login/blabla/hackingthis ## 3. Redo 1 untill caseUrl returns value. (If null, then terminate with 404) $url = $routes[$case3Url]; // -> OK (/login) $url = $routes[$case4Url - last_param]; // -> FAIL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants