1. Go to this page and download the library: Download watson/active library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
watson / active example snippets
active()
is_active()
active(['login', 'users/*', 'posts.*', 'pages.contact']); // Returns 'active' if the current route matches any path or route name.
active(['login', 'logout'], 'active-class'); // Returns 'active-class' if the current route is 'login' or 'logout'.
active(['login', 'logout'], 'active-class', 'fallback-class'); // Returns 'fallback-class' if the current route is not 'login' or 'logout'.