Skip to content

Commit 6dd7b51

Browse files
committed
[docs] Working a bit more on the README.
1 parent c5be078 commit 6dd7b51

File tree

2 files changed

+77
-8
lines changed

2 files changed

+77
-8
lines changed

README.markdown

+75-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
ioDoctrineMenuPlugin
22
====================
33

4+
Adds a data persistence layer to `ioMenuPlugin`. Create simple object-oriented
5+
menus and then easily persist them to and retrieve them from the database.
6+
7+
This plugin also comes with an admin module to edit the menu items. The
8+
admin module is complete with draggable ordering of the menu items.
9+
410
The majority of the documentation can be found on the `ioMenuItemPlugin`
511
[http://github.com/weaverryan/ioMenuPlugin/tree/master/docs/](here).
612

7-
Quick documentation
8-
-------------------
13+
Introduction
14+
------------
915

10-
Adds a data persistence layer to `ioMenuPlugin`. Create simple object-oriented
11-
menus and then easily persist them to and retrieve them from the database.
16+
The core purpose of this plugin is to provide a persistence layer to the
17+
`ioMenuItem` objects from the `ioMenuPlugin`.
18+
19+
### Persisting menu items
1220

13-
First, create a menu item and persist it to the database.
21+
First, let's create a menu item and persist it to the database.
1422

1523
$menu = new ioMenuItem('root', '@homepage');
1624
$menu->addChild('Sympal', 'http://www.sympalphp.org');
@@ -21,11 +29,23 @@ First, create a menu item and persist it to the database.
2129
// persist the menu to the database
2230
Doctrine_Core::getTable('ioDoctrineMenuItem')->persist($menu);
2331

24-
Next, aasily retrieve the menu item from the database:
32+
There is now a root menu item called `root` in the `ioDoctrineMenuItem`
33+
model with two children. This model uses Doctrine's nested set.
34+
35+
### Retrieving menu items
36+
37+
Next, easily retrieve the menu item from the database. The resulting
38+
`$menu` object is alightweight, easy-to-use `ioMenuItem` menu tree.
2539

2640
$menu = Doctrine_Core::getTable('ioDoctrineMenuItem')
2741
->fetchMenu('root');
2842

43+
At this point, you can make changes to your `$menu` variable and then
44+
re-persist to the database. The plugin will update any changes to the
45+
nested set in the database.
46+
47+
### Caching
48+
2949
Additionally, caching of the doctrine menu items is automatically handled
3050
if you retrieve the menu items from the menu manager. For example, from
3151
the actions:
@@ -41,6 +61,55 @@ caching:
4161
<?php use_helper('DoctrineMenu') ?>
4262
<?php $menu = get_doctrine_menu('admin') ?>
4363

64+
Installation
65+
------------
66+
67+
This plugin requires the ioMenuPlugin.
68+
69+
### With git
70+
71+
git submodule add git://github.com/weaverryan/ioDoctrineMenuPlugin.git plugins/ioDoctrineMenuPlugin
72+
git submodule add git://github.com/weaverryan/ioMenuPlugin.git plugins/ioMenuPlugin
73+
git submodule init
74+
git submodule update
75+
76+
### With subversion
77+
78+
svn propedit svn:externals plugins
79+
80+
In the editor that's displayed, add the following entry and then save
81+
82+
ioDoctrineMenuPlugin https://svn.github.com/weaverryan/ioDoctrineMenuPlugin.git
83+
ioMenuPlugin https://svn.github.com/weaverryan/ioMenuPlugin.git
84+
85+
Finally, update:
86+
87+
svn up
88+
89+
# Setup
90+
91+
In your `config/ProjectConfiguration.class.php` file, make sure you have
92+
the plugin enabled.
93+
94+
$this->enablePlugins('ioMenuPlugin', 'ioDoctrineMenuPlugin');
95+
96+
Configuration
97+
-------------
98+
99+
All configuration for this plugin can be found in the `config/app.yml`
100+
file packaged with the plugin.
101+
102+
The most important configuration options are those related to i18n. To
103+
enable internationalization, be sure to set the following in your `app.yml`
104+
file:
105+
106+
all:
107+
doctrine_menu:
108+
use_i18n: true
109+
i18n_cultures:
110+
en: English
111+
fr: Français
112+
44113
Care to Contribute?
45114
-------------------
46115

config/app.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ all:
44
use_i18n: false
55
# array of cultures that will be shown in the admin module
66
i18n_cultures: []
7-
#en: English
8-
#fr: Français
7+
# en: English
8+
# fr: Français
99

1010
# The routing prefix to use for the menu admin module
1111
module_prefix: /admin/menu

0 commit comments

Comments
 (0)