Hi everybody,
I want to create 2 routes below:
- For main cate: /{cate:[a-z]{2}} (only have 2 characters from a-z)
- For sub cate: /{sub_cate:[a-z0-9-]+}-{cate:[a-z]{2}} (normal sub cate slug and end with main cate slug)
But it's not work. Can you give me some solutions?
Route source:
$router->add( "/{cate:[a-z]{2}}", "Category::cate" );
$router->add( "/{sub_cate:[a-z0-9-]+}-{cate:[a-z]{2}}/", "Category::sub" );
Sample:
- example.com/xd
- example.com/funny-story-2017-xd