folded-php / folded-php/routing

To be able to check if multiples routes match the current URL

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
PHP
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Description

I currently have to use multiple times `currentRouteIs()` for highlighting a dropdown menu.

## Expected behavior

To be able to specify multiples routes.

```php
use function Folded\currentRouteIs;

if (currentRouteIs(["home.index", "popular.index"])) {
// This is either the home page or the popular posts page
} else {
// This is another page
}
```

## Alternatives solutions

To chain calls:

```php
if (currentRouteIs("home.index") || currentRouteIs("popular.index")) {
// ...
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.