Skip to content

Commit 2b4b248

Browse files
authored
Merge pull request #23 from AtomicXtreme/3.0
Documentation for Dot-Navigation
2 parents 443f06b + 8291c3c commit 2b4b248

17 files changed

Lines changed: 202 additions & 147 deletions
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
tags:
8+
9+
jobs:
10+
ci:
11+
uses: laminas/workflow-continuous-integration/.github/workflows/continuous-integration.yml@1.x

.github/workflows/cs-tests.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/docs-build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: docs-build
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Build Docs
13+
uses: dotkernel/documentation-theme/github-actions/docs@main
14+
env:
15+
DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/static-analysis.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
[![SymfonyInsight](https://insight.symfony.com/projects/68b7c728-4cc9-40ac-a3be-cf17f9b2eaf1/big.svg)](https://insight.symfony.com/projects/68b7c728-4cc9-40ac-a3be-cf17f9b2eaf1)
1515

16-
1716
Allows you to easily define and parse menus inside templates, configuration based approach.
1817

1918
## Installation
@@ -33,7 +32,6 @@ Register `NavigationMiddleware` in your middleware pipe between the routing and
3332

3433
Locate dot-navigation's distributable config file `vendor/dotkernel/dot-navigation/config/autoload/navigation.global.php.dist` and duplicate it in your project as `config/autoload/navigation.global.php`
3534

36-
3735
## Components
3836

3937
A menu, or navigation container, is a class implementing the \RecursiveIterator interface. It has a hierarchical structure, with nodes called pages(see the `Page` class) that may have children. It is basically a tree
@@ -48,7 +46,6 @@ Attributes are key value pairs that defines the menu item. They are usually inse
4846

4947
A `NavigationService` class, is the service that handles all defined menu container. It can fetch the container from its provider, check if a page is active or not and get the page's generated URI.
5048

51-
5249
## Container providers
5350

5451
Each menu can be created from different sources. The responsibility of creating a menu container from the source falls on a container provider.
@@ -57,7 +54,6 @@ Each provider must implement the interface `ProviderInterface` and be registered
5754

5855
We offer just one provider for now, `ArrayProvider`, that is able to fetch and create a menu container from a php array that is defined in the configuration file.
5956

60-
6157
## NavigationRenderer
6258

6359
Used to render the navigation container in a displayable format. It can render a simple HTML ul list or use a partial template, to render the menu in a template engine.
@@ -66,14 +62,14 @@ The partial method is usually the more flexible one, custom rules can be defined
6662

6763
If you are using twig, there is already a twig extension provided in package dot-twigrenderer, that you can use to easily parse the menus inside your templates
6864

69-
7065
When using the partial method, the template will receive as parameters the container, the navigation service and any extra parameters set by the developer.
7166

7267
Navigation containers are referred, when parsed, by their name, as defined in the configuration file.
7368

7469
## Required page options and attributes
7570

7671
The following are options that each page should define in the configuration
72+
7773
* `label` - the text of the menu item
7874
* `route` or `uri` - defines the route or link the menu item will have
7975
* `permission` - can be used optionally, if authorization service is present, in order to omit menu items that are not authorized to visit.

SECURITY.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
6+
| Version | Supported | PHP Version |
7+
|---------|--------------------|---------------------------------------------------------------------------------------------------------------|
8+
| 3.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-navigation/3.4.2)|
9+
10+
11+
## Reporting Potential Security Issues
12+
13+
If you have encountered a potential security vulnerability in this project,
14+
please report it to us at <security@dotkernel.com>. We will work with you to
15+
verify the vulnerability and patch it.
16+
17+
When reporting issues, please provide the following information:
18+
19+
- Component(s) affected
20+
- A description indicating how to reproduce the issue
21+
- A summary of the security vulnerability and impact
22+
23+
We request that you contact us via the email address above and give the
24+
project contributors a chance to resolve the vulnerability and issue a new
25+
release prior to any public exposure; this helps protect the project's
26+
users, and provides them with a chance to upgrade and/or update in order to
27+
protect their applications.
28+
29+
30+
## Policy
31+
32+
If we verify a reported security vulnerability, our policy is:
33+
34+
- We will patch the current release branch, as well as the immediate prior minor
35+
release branch.
36+
37+
- After patching the release branches, we will immediately issue new security
38+
fix releases for each patched release branch.
39+

docs/book/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README.md

docs/book/v3/components.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Components
2+
3+
A menu, or navigation container, is a class implementing the \RecursiveIterator interface. It has a hierarchical structure, with nodes called pages(see the `Page` class) that may have children. It is basically a tree
4+
5+
A Page extends the NavigationContainer class. The NavigationContainer is the top most node which represents the entire menu. The children of this node are Page instances that defines each navigation item.
6+
7+
A page has a reference to its parent, and can have options and attributes. There are no limitation on what is accepted as options or attributes.
8+
9+
Options can be any piece of information that describes a page. Some predefined options exists, in order for the navigation module to work seamlessly with other dot modules.
10+
11+
Attributes are key value pairs that defines the menu item. They are usually inserted as html attributes when parsing the menu, but of course, this is implementation specific.
12+
13+
A `NavigationService` class, is the service that handles all defined menu container. It can fetch the container from its provider, check if a page is active or not and get the page's generated URI.

docs/book/v3/configuration.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Configuration
2+
3+
After installation, register `dot-navigation` in your project by adding the below line to your configuration aggregator (usually: `config/config.php`):
4+
5+
Dot\Navigation\ConfigProvider::class,
6+
7+
Locate dot-navigation's distributable config file `vendor/dotkernel/dot-navigation/config/autoload/navigation.global.php.dist` and duplicate it in your project as `config/autoload/navigation.global.php`

0 commit comments

Comments
 (0)