Closed n0nag0n closed 6 months ago
@krmu Thanks so much for the feedback! I haven't used this as heavily as some of you other devs out there. I didn't go back and catch optional params so I can build tests against that and figure out why it's not working on group and unit test against that.
Thank you for fixing aliases, now we have another issue with params that has numbers inside. Code:
Flight::route('/homepage(/@param1)', function ($param1) {
echo 'Homepage';
},false,$alias = 'homepage');
Flight::start();
echo "Url:". Flight::getUrl('homepage',array('param1'=>'test'));
Response:
Url:/homepage/1)
@krmu Ok I have grouping fixed and tested against (with your very example) and I fixed the params with numbers in them. I noticed that earlier, but I wasn't sure if numbers were valid as url params. Whelp, they are now :D
P.S. You could hop in the chat room if you ever wanted to discuss anything. I usually keep that tab open on my computer. Chat room link is on the Readme
Im not sure, but seems that it still wont work. Currently not even allowing to get simple url.
Possibly??? This is me statically calling getUrl() just fine.
And it definitely is a mapped method.
Everything works, my bad. Sorry for that. So currently this monster from:
Flight::group('/user', function () {
Flight::group('/all_users', function () {
Flight::group('/check_user', function () {
Flight::group('/check_one', function () {
Flight::route("/normalpath", function () {
echo "normalpath";
},false,"normalpathalias");
});
});
});
});
Converts into:
normalpath/user/all_users/check_user/check_one/normalpath
So it works.
Also numbered params works.
k, I just need to add some docs to the readme and then it looks like this can go live and be versioned.
Added the ability to set an alias and to rehydrate a url