php - Route @token confusion -
apologies if has been asked.
i working on project looking display locations of business. can either state, or city (in state).
i trying work these 2 routes:
get /@state /@city-@state
@state works well, when try navigate @city-@state page, errors because trying load @state page, , cannot find required data.
looking @ base.php, found preg_match_all matching \w, should ignoring hyphen(-), reason isn't.
i need urls in structure.
can me notice missing?
thanks!
i don't think f3 allows use dash separate tokens in url; hence why it's matching first token (@state).
the regex used grab tokens '/@(\w+)/', wants slash character separate tokens. suggest using /@state , /@city/@state.
Comments
Post a Comment