Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

Commit

Permalink
Menu documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rogergros committed Mar 10, 2015
1 parent b87f437 commit b35a75c
Show file tree
Hide file tree
Showing 2 changed files with 249 additions and 20 deletions.
138 changes: 128 additions & 10 deletions src/Elcodi/Bundle/MenuBundle/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,140 @@
Elcodi Menu Bundle for Symfony2
===============================

# Table of contents

1. [Bundle](#bundle)
1. [Overview](#overview)
1. [Installation & Configuration](#installation-configuration)
1. [Dependencies](#dependencies)
1. [Tests](#tests)
1. [Model layer](#model-layer)
1. [Service layer](#service-layer)
1. [Event layer](#event-layer)
1. [Controllers](#controllers)
1. [Commands](#commands)
1. [Tags](#tags)
1. [Contributing](#contributing)

# Bundle

This bundle is part of [elcodi project](https://github.com/elcodi).
Elcodi is a set of flexible e-commerce components for Symfony2, built as a
decoupled and isolated repositories and under
[MIT](http://opensource.org/licenses/MIT) license.
[MIT] license.

# Overview

The menu bundle allows you to create menus for your project.
This bundle is used on the [Bamboo] store to build the Admin menu on the
store backend.

# Installation & Configuration

You can install this Bundle the same way you will do with another [Symfony]
bundle, you'll find info on this [symfony documentation page][4]

In a few words, you can use [Composer] to install the bundle getting the package
from
[elcodi/menu-bundle packagist](https://packagist.org/packages/elcodi/menu-bundle)
by just adding a line in your composer.json

``` json
{
"require": {
"elcodi/menu-bundle": "~0.5.*"
}
}

```

Or executing the following line

``` bash
$ composer require "elcodi/menu-bundle:~0.5.*"
```

After that you'll have to enable the bundle on your `Appkernel` file.

``` php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
// ...

public function registerBundles()
{
$bundles = array(
// ...,
new \Elcodi\Bundle\MenuBundle\ElcodiMenuBundle(),
);

// ...
}
}
```

# Dependencies

The Menu bundle has dependencies with:

- **PHP:** Version greater or equal to 5.4
- **doctrine/common:** A doctrine extension for php
- **doctrine/orm:** The doctrine object-relational mapping
- **doctrine/doctrine-cache-bundle:** To save the menu build on cache
- **symfony/http-kernel:** The Symfony http kernel component needed to extend
the bundle
- **symfony/config:** The symfony config component, needed to override the
configuration
- **symfony/dependency-injection:** The symfony dependency injection component,
needed to define services
- **symfony/twig-bundle:** To use symfony twig extensions e.g. assets
- **mmoreram/simple-doctrine-mapping:** Needed on the compiler pass to be able
to load the entities and related classes from the annotations
- **elcodi/core-bundle:** Elcodi core bundle component
- **elcodi/menu:** Elcodi menu component

# Tests

*Tests docs*

# Model layer

The menu bundle provides you some services to work with the Geo models.

[More info about the model classes on the component documentation](https://github.com/elcodi/Menu/blob/master/README.md#model-layer)

## Menu

- `@elcodi.factory.menu`: A factory to generate a new menu entity
- `@elcodi.object_manager.menu`: A menu entity manager
- `@elcodi.repository.menu`: A menu repository

## Node

- `@elcodi.factory.menu_node`: A factory to generate a new menu node entity
- `@elcodi.object_manager.menu_node`: A menu node entity manager
- `@elcodi.repository.menu_node`: A menu node repository

# Service layer

These are the useful bundle services that you should know.

[More info about the services classes on the component documentation](https://github.com/elcodi/Menu/blob/master/README.md#service-layer)

Documentation
-------------
## Services

Check the documentation in [Elcodi Docs](http://docs.elcodi.io). Feel free to
propose new recipes, examples or guides; our main goal is to help the developer
building their site.
- `@elcodi.manager.menu`: The menu manager generates a full menu structure
loading the data from the repository.

Tags
----
# Tags

* Use last unstable version ( alias of `dev-master` ) to stay always in last commit
* Use last stable version tag to stay in a stable release.

Contributing
------------
# Contributing

All issues and Pull Requests should be on the main repository
[elcodi/elcodi](https://github.com/elcodi/elcodi), so this one is read-only.
Expand All @@ -42,3 +156,7 @@ in the [Submitting a Patch][2] section and use the [Pull Request Template][3].
[1]: http://symfony.com/doc/current/contributing/code/index.html
[2]: http://symfony.com/doc/current/contributing/code/patches.html#check-list
[3]: http://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request
[MIT]: http://opensource.org/licenses/MIT
[Bamboo]: https://github.com/elcodi/bamboo
[Composer]: https://getcomposer.org/
[Symfony]: http://symfony.com/
131 changes: 121 additions & 10 deletions src/Elcodi/Component/Menu/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,134 @@
Elcodi Menu component for Symfony2
==================================

This bundle is part of [elcodi project](https://github.com/elcodi).
# Table of contents

1. [Component](#component)
1. [Overview](#overview)
1. [Installation](#installation)
1. [Dependencies](#dependencies)
1. [Tests](#tests)
1. [Model layer](#model-layer)
* [Menu](#menu)
* [Node](#node)
1. [Service layer](#service-layer)
* [Services/MenuManager.php](#servicesmenumanagerphp)
1. [Twig extensions](#twig-extensions)
* [PrintMoneyExtension](#printroutextension)
1. [Tags](#tags)
1. [Contributing](#contributing)

# Component

This component is part of [elcodi project](https://github.com/elcodi).
Elcodi is a set of flexible e-commerce components for Symfony2, built as a
decoupled and isolated repositories and under
[MIT](http://opensource.org/licenses/MIT) license.

Documentation
-------------
# Overview

The menu component allows you to create menus for your project.
This component is used on the [Bamboo] store to build the Admin menu on the
store backend.

# Installation

You can use [Composer] to install this component getting the package from
[elcodi/menu packagist](https://packagist.org/packages/elcodi/menu) by
just adding a line in your composer.json

``` json
{
"require": {
"elcodi/menu": "~0.5.*"
}
}

```

Or executing the following line

``` bash
$ composer require "elcodi/menu:~0.5.*"
```

# Dependencies

The Geo component has dependencies with:
- **PHP:** Version greater or equal to 5.4
- **doctrine/common:** A doctrine extension for php
- **doctrine/orm:** The doctrine object-relational mapping
- **symfony/routing:** Used to generate the menu urls
- **elcodi/core:** Elcodi core components

# Tests

*Tests docs*

# Model layer

The model for this component adds all the tools needed to represent the menus

## Menu

[View code](https://github.com/elcodi/Menu/blob/master/Entity/Menu/Menu.php)

The menu entity maps represents an entire menu.

**Fields**
- **Id:** The identifier **(Unique)**
- **Code:** The menu code. `e.g. admin`
- **Description:** The menu description. `e.g. The admin menu`
- **Sort:** The sort type. `e.g. ASC`
- **Subnodes:** The menu subnodes
- **Enabled**: If the address is enabled. `e.g. 1`

## Node

[View code](https://github.com/elcodi/Menu/blob/master/Entity/Menu/Node.php)

The node entity maps each of the nodes of the menu, saving the menu node
properties.

**Fields**
- **Id:** The identifier **(Unique)**
- **Code:** The menu code. `e.g. admin`
- **Name:** The node name. `e.g. Products`
- **Url:** The node route. `e.g. products_list`
- **Active urls:** The node active urls, saved in JSON format.
`e.g. ["url_products_list","url_products_edit"]`
- **Sort:** The sort type. `e.g. ASC`
- **Subnodes:** The node subnodes
- **Enabled**: If the address is enabled. `e.g. 1`

# Service layer

These are the useful component services that you should know.

## Services/MenuManager.php

[View code](https://github.com/elcodi/Menu/blob/master/Services/MenuManager.php)

The menu manager generates a full menu structure loading the data from the
repository.

**e.g.** *This service is used on the [Bamboo] backend to build the admin menu*

# Twig extensions

## PrintRouteExtension

[View code](https://github.com/elcodi/Menu/blob/master/Twig/PrintRouteExtension.php)

Check the documentation in [Elcodi Docs](http://docs.elcodi.io). Feel free to
propose new recipes, examples or guides; our main goal is to help the developer
building their site.
This twig extension provides:
- `printUrl(route)`: Generates a url for the given route.

Tags
----
# Tags

* Use last unstable version ( alias of `dev-master` ) to stay always in last commit
* Use last stable version tag to stay in a stable release.

Contributing
------------
# Contributing

All issues and Pull Requests should be on the main repository
[elcodi/elcodi](https://github.com/elcodi/elcodi), so this one is read-only.
Expand All @@ -42,3 +150,6 @@ in the [Submitting a Patch][2] section and use the [Pull Request Template][3].
[1]: http://symfony.com/doc/current/contributing/code/index.html
[2]: http://symfony.com/doc/current/contributing/code/patches.html#check-list
[3]: http://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request
[MIT]: (http://opensource.org/licenses/MIT)
[Composer]: (https://getcomposer.org/)
[Bamboo]: https://github.com/elcodi/bamboo

0 comments on commit b35a75c

Please sign in to comment.