@isPath directive is similar to @inPath() directive. The difference is that
while @inPath() checks for the parent url, @isPath() matches the
the exact supplied url with the current page request url. If both url paths matches, the second argument
supplied will be returned. The example below shows how the @isPath() directive can be applied in template files.
Assumed Page 2: http://localhost/docs/some/page @inPath('docs.some.page', 'hi') returns "hi" Assumed Page 1: http://localhost/docs/some/page @inPath('docs.some', 'hi') returns ""
<a href="@domurl('docs/resource')" class="@isPath(':dom-path','active')">
<a href="@domurl('docs/users')" class="@isPath(':dom-path','active')">
active will be returned once the relative @domurl() path is
visited. This happens because the :dom-path will automatically test for the last path supplied on
@domurl, saving us the time to rewrite urls. This behaviour is good for navigation bar menus.
Also, for this to work, the @inPath() must come immediately after @domurl() directive is used. Now
it even gets easier when only one argument is supplied. If it is only one single argument supplied on @isPath(), then
@isPath will automatically call the :dom-path argument on itself just like the @inPath()
directive. This helps to save a lot of time when building web applications. This means that the code above can be rewritten as shown below
<a href="@domurl('docs/resource')" class="@isPath('active')">
<a href="@domurl('docs/users')" class="@isPath('active')">