Replies: 2 comments 1 reply
-
Hey there! So excited to see that you are trying out HydePHP! This feature hasn't been documented properly get, so I'll do my best to help. Let me know if you have any questions at all, I'm happy to help! How pages/routes work (the long answer)All pages have a In addition, all pages also have a public function isCurrent(?PageContract $current = null): bool
{
if ($current === null) {
$current = Hyde::currentRoute()->getSourceModel();
}
if (! isset($this->route)) {
return ($current->getRoute()->getRouteKey() === $this->href)
|| ($current->getRoute()->getRouteKey().'.html' === $this->href);
}
return $current->getRoute()->getRouteKey() === $this->route->getRouteKey();
} The short answerAs you can see, we are using the route key, you can use this in your case. So instead of I hope this answers your question, if not, please let me know as I'm more than happy to help! |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for the detailed answer. I am just trying/playing with SSG's. I was actually surprised when I saw all issues belongs to you. I am thinking this gonna be part of a SAAS eventually. I tried your suggestions:
I've finally end with this, if I keep navigation in a array and loop it, it's gonna be more clean.
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I am using only blade. How can access to current url?
Like below one but for global usage.
$item->isCurrent()
Something like this ?
Beta Was this translation helpful? Give feedback.
All reactions