{"id":33999988,"url":"https://github.com/anetwork/sidenav","last_synced_at":"2025-12-13T09:10:26.005Z","repository":{"id":56948253,"uuid":"70317582","full_name":"anetwork/sidenav","owner":"anetwork","description":"🚀 Sidebar navigation management","archived":false,"fork":false,"pushed_at":"2018-01-01T07:32:44.000Z","size":33,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-19T19:32:20.416Z","etag":null,"topics":["sidebar","sidebar-navigation","sidenav","submenu"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anetwork.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-08T08:44:40.000Z","updated_at":"2024-11-02T00:55:02.000Z","dependencies_parsed_at":"2022-08-21T08:20:17.198Z","dependency_job_id":null,"html_url":"https://github.com/anetwork/sidenav","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/anetwork/sidenav","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anetwork%2Fsidenav","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anetwork%2Fsidenav/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anetwork%2Fsidenav/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anetwork%2Fsidenav/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anetwork","download_url":"https://codeload.github.com/anetwork/sidenav/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anetwork%2Fsidenav/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27702934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-13T02:00:09.769Z","response_time":147,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sidebar","sidebar-navigation","sidenav","submenu"],"created_at":"2025-12-13T09:10:25.398Z","updated_at":"2025-12-13T09:10:25.998Z","avatar_url":"https://github.com/anetwork.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/anetwork/sidenav.svg?branch=master)](https://travis-ci.org/anetwork/sidenav)\n[![Latest Stable Version](https://poser.pugx.org/anetwork/sidenav/v/stable)](https://packagist.org/packages/anetwork/sidenav)\n[![Total Downloads](https://poser.pugx.org/anetwork/sidenav/downloads)](https://packagist.org/packages/anetwork/sidenav)\n[![Latest Unstable Version](https://poser.pugx.org/anetwork/sidenav/v/unstable)](//packagist.org/packages/anetwork/sidenav)\n[![License](https://poser.pugx.org/anetwork/sidenav/license)](https://packagist.org/packages/anetwork/sidenav)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/anetwork/sidenav/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/anetwork/sidenav/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/anetwork/sidenav/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/anetwork/sidenav/?branch=master)\n\n# Anetwork SideNav\nSideNav is a PHP package which helps you generate powerful sidebar navigation.\n\n# Features\n\n* SubMenu : Define your submenu to item\n* Grouping : Define your items in groups\n* Cheking : Define dynamic menues and submenues with if statement support\n\n# Introduction\n* A php component that makes it easier to build vertical nav menus\n* The sidenav package can manage your sidebar navigations items on your project\n* you can install this package with composer and config your sidebar navigations items\n\n## Requirement\n* php 5.5 \u003e=\n* HHVM\n\n## Install with composer\nYou can install this package throw the [Composer](http://getcomposer.org) by running:\n\n```\ncomposer require anetwork/sidenav\n```\n\n## Register a new item\n* you should use the register method of sidenav object\n* the method wants 2 arguments\n* the first one should be a string of your item name\n* the second one must be a function literal to use Menu Object for define all of menu options\n\n```php\nSideNav::register('item_name',function($menu){\n\n    $menu-\u003elink('the_item_url');\n    \n    $menu-\u003etitle('the title');\n    \n    $menu-\u003eclassName('class-name'); // Item css class attribute\n    \n    $menu-\u003eicon('fa fa-example'); //  use on font-awesome icon\n    \n    // Register submenu to item\n    $menu-\u003esub('sub_item_name',function ($menu){\n        $menu-\u003elink('the_item_url');\n        $menu-\u003etitle('the submenu title');\n        $menu-\u003eicon('fa fa-example');\n        $menu-\u003eclassName('submenu-class-name');\n    });\n    \n    /**\n     * \n     * Register another one ...\n     *\n     */\n    \n});\n```\n\n## Register submenu with Check Status\nIf you want register a submenu in item with checkStatus, you should use subWithCheck method of Menu Object\n* the method , accepts 3 arguments\n* first one must be a string of your item name\n* second one must be function literal to use Menu Object for define all of menu options\n* third one must be a function literal of your check state , return of function must be true or false\n\n\n```php\nSideNav::register('item_name',function($menu){\n\n    /**\n     * \n     * Items options ...\n     *\n     */\n     \n     $menu-\u003esubWithCheck('sub_item_name',function($menu){\n     \n        /**\n         * \n         * Item options ...\n         *\n         */\n        \n     },functiion(){\n     \n        // checking area\n        // you can define the if statement here to return boolean | true or false\n        // :: Example\n        \n        if($_SESSION['user_id'] == 2){\n            return true;\n        }\n        \n        return false;\n     \n     });\n    \n});\n```\n\n\n## Register With Check Status\nIf you want register a item with checkStatus, you should use registerWithCheck method of SideNav Object\n* the method , accepts 3 arguments\n* first one must be a string of your item name\n* second one must be function literal to use Menu Object for define all of menu options\n* third one must be a function literal of your check state , return of function mustb be true or false\n\n```php\nSideNav::registerWithCheck('item_name',function($menu){\n\n    $menu-\u003elink('the_item_url');\n    \n    $menu-\u003etitle('the title');\n    \n    $menu-\u003eclassName('class-name');\n    \n    $menu-\u003eicon('fa fa-example');  \n    \n},function(){\n\n    // checking area\n    // you can define the if statement here to return boolean | true or false\n    // :: Example\n    \n    if($_SESSION['user_id'] == 2){\n        return true;\n    }\n    return false;\n});\n```\n\n## Group\n* You can make a group menu with SideNav::group method\n\n```php\nSideNav::group('user',function(){\n\n    // Registering Items\n\n});\n```\n\n### Render\n* You can use the render method of SideNav object to return your menu array\n```php\nSideNav::render();\n```\n\n* if you want to render your group , just call your group name in argument\n\n```php\nSideNav::render('name_of_your_group');\n```\n\n\n### Menu options\n\n| Method  | status | Parameter | Type of parameter | \n| ------- | ------ | --------- | -------- |\n| `-\u003eicon()` | required | Define icon class | String |\n| `-\u003elink()` | required | Set link of item | String |\n| `-\u003eregex()` | optional | Set the regex of item link | array |\n| `-\u003eclassName()` | optional | The class of item | String |\n| `-\u003enewTab()` | optional | newTab link target | Boolean : defalt =\u003e false |\n| `-\u003etitle()` | required | The title of item | String |\n| `-\u003eisNew()` | optional | Define the item is new | Boolean : default =\u003e false |\n| `-\u003eselected()` | optional | item selected status | Boolean : default =\u003e false |\n| `-\u003eopenChildOnClick()` | optional | the sub menu status | Boolean : default =\u003e true |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanetwork%2Fsidenav","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanetwork%2Fsidenav","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanetwork%2Fsidenav/lists"}