Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[docs] Working a bit more on the README.

  • Loading branch information...
commit 6dd7b51525c6892f4270164830c10ee4fe8e53c8 1 parent c5be078
@weaverryan authored
Showing with 77 additions and 8 deletions.
  1. +75 −6 README.markdown
  2. +2 −2 config/app.yml
View
81 README.markdown
@@ -1,16 +1,24 @@
ioDoctrineMenuPlugin
====================
+Adds a data persistence layer to `ioMenuPlugin`. Create simple object-oriented
+menus and then easily persist them to and retrieve them from the database.
+
+This plugin also comes with an admin module to edit the menu items. The
+admin module is complete with draggable ordering of the menu items.
+
The majority of the documentation can be found on the `ioMenuItemPlugin`
[http://github.com/weaverryan/ioMenuPlugin/tree/master/docs/](here).
-Quick documentation
--------------------
+Introduction
+------------
-Adds a data persistence layer to `ioMenuPlugin`. Create simple object-oriented
-menus and then easily persist them to and retrieve them from the database.
+The core purpose of this plugin is to provide a persistence layer to the
+`ioMenuItem` objects from the `ioMenuPlugin`.
+
+### Persisting menu items
-First, create a menu item and persist it to the database.
+First, let's create a menu item and persist it to the database.
$menu = new ioMenuItem('root', '@homepage');
$menu->addChild('Sympal', 'http://www.sympalphp.org');
@@ -21,11 +29,23 @@ First, create a menu item and persist it to the database.
// persist the menu to the database
Doctrine_Core::getTable('ioDoctrineMenuItem')->persist($menu);
-Next, aasily retrieve the menu item from the database:
+There is now a root menu item called `root` in the `ioDoctrineMenuItem`
+model with two children. This model uses Doctrine's nested set.
+
+### Retrieving menu items
+
+Next, easily retrieve the menu item from the database. The resulting
+`$menu` object is alightweight, easy-to-use `ioMenuItem` menu tree.
$menu = Doctrine_Core::getTable('ioDoctrineMenuItem')
->fetchMenu('root');
+At this point, you can make changes to your `$menu` variable and then
+re-persist to the database. The plugin will update any changes to the
+nested set in the database.
+
+### Caching
+
Additionally, caching of the doctrine menu items is automatically handled
if you retrieve the menu items from the menu manager. For example, from
the actions:
@@ -41,6 +61,55 @@ caching:
<?php use_helper('DoctrineMenu') ?>
<?php $menu = get_doctrine_menu('admin') ?>
+Installation
+------------
+
+This plugin requires the ioMenuPlugin.
+
+### With git
+
+ git submodule add git://github.com/weaverryan/ioDoctrineMenuPlugin.git plugins/ioDoctrineMenuPlugin
+ git submodule add git://github.com/weaverryan/ioMenuPlugin.git plugins/ioMenuPlugin
+ git submodule init
+ git submodule update
+
+### With subversion
+
+ svn propedit svn:externals plugins
+
+In the editor that's displayed, add the following entry and then save
+
+ ioDoctrineMenuPlugin https://svn.github.com/weaverryan/ioDoctrineMenuPlugin.git
+ ioMenuPlugin https://svn.github.com/weaverryan/ioMenuPlugin.git
+
+Finally, update:
+
+ svn up
+
+# Setup
+
+In your `config/ProjectConfiguration.class.php` file, make sure you have
+the plugin enabled.
+
+ $this->enablePlugins('ioMenuPlugin', 'ioDoctrineMenuPlugin');
+
+Configuration
+-------------
+
+All configuration for this plugin can be found in the `config/app.yml`
+file packaged with the plugin.
+
+The most important configuration options are those related to i18n. To
+enable internationalization, be sure to set the following in your `app.yml`
+file:
+
+ all:
+ doctrine_menu:
+ use_i18n: true
+ i18n_cultures:
+ en: English
+ fr: Français
+
Care to Contribute?
-------------------
View
4 config/app.yml
@@ -4,8 +4,8 @@ all:
use_i18n: false
# array of cultures that will be shown in the admin module
i18n_cultures: []
- #en: English
- #fr: Français
+ # en: English
+ # fr: Français
# The routing prefix to use for the menu admin module
module_prefix: /admin/menu
Please sign in to comment.
Something went wrong with that request. Please try again.