![]() |
|
ioMenuPlugin - 0.7.0A plugin to make menus easier to write in symfony. |
|
![]() |
22
users
Sign-in
to change your status |
A plugin to make menus easier to write in symfony. |
A plugin to make menus easier to write in symfony.
active classfirst and last classesInspired by sympal and the SemanticMenu from Ruby on Rails.
| Name | Status | |
|---|---|---|
|
|
lead | moc.oidutsoi <<ta>> revaew.nayr |
Copyright (c) 2010 Ryan Weaver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
| Version | License | API | Released |
|---|---|---|---|
| 0.7.0beta | MIT license | 0.7.0beta | 27/06/2010 |
| 0.6.0beta | MIT license | 0.6.0beta | 30/05/2010 |
| Version | License | API | Released |
|---|---|---|---|
| 0.7.0beta | MIT license | 0.7.0beta | 27/06/2010 |
| 0.6.0beta | MIT license | 0.6.0beta | 30/05/2010 |
Several bug fixes and a string list of new features: * Added 5 chapters of documentation in docs directory * Added reordering of children methods with tests * Added split and splice() methods with tests * Added i18n support with tests * Added a __toString() method with test
Several bug fixes and a string list of new features: * Added 5 chapters of documentation in docs directory * Added reordering of children methods with tests * Added split and splice() methods with tests * Added i18n support with tests * Added a __toString() method with test
Initial release of the plugin - young, but well-tested.
A plugin to make menus easier to write in symfony.
active classfirst and last classesInspired by sympal and the SemanticMenu from Ruby on Rails.
A small book has been written to support this plugin and ioDoctrineMenuItemPlugin: Menu Reference Manual.
Assume any of the routes have been defined in routing.yml:
$menu = new ioMenu();
$menu->addChild('overview', '@homepage');
$menu->addChild('comments', '@comments');
echo $menu->render();
Assuming you are on /comments, the output would be:
<ul class="menu">
<li class="first">
<a href="/">overview</a>
</li>
<li class="current last">
<a href="/comments">comments</a>
</li>
</ul>
The ioMenu class optionally takes an array of attributes as its first
argument. You can also nest menus as deeply as you want:
$menu = new ioMenu(array('class' => 'top_level_nav'));
$menu->addChild('overview', '@homepage');
$menu->addChild('comments', '@comments', array('class' => 'button'));
$menu['comments']->addChild('My Comments', '@my_comments');
$menu['comments']->addChild('Recent', '@recent_comments');
echo $menu->render();
Assuming you're in the /my-comments page, the output would be:
<ul class="top_level_nav">
<li class="first">
<a href="/">overview</a>
</li>
<li class="button current_ancestor last">
<a href="/comments">comments</a>
<ul class="menu_level_1">
<li class="current first">
<a href="/my-comments">My Comments</a>
</li>
<li class="last">
<a href="/recent">Recent</a>
</li>
</ul>
</li>
</ul>
git submodule add git://github.com/weaverryan/ioMenuPlugin.git plugins/ioMenuPlugin
git submodule init
git submodule update
svn propedit svn:externals plugins
In the editor that's displayed, add the following entry and then save
ioMenuPlugin https://svn.github.com/weaverryan/ioMenuPlugin.git
Finally, update:
svn up
In your config/ProjectConfiguration.class.php file, make sure you have
the plugin enabled.
$this->enablePlugins('ioMenuPlugin');
An in-depth reference manual is available: Menu Reference Manual.
Please clone and improve this plugin! This plugin is by the community and for the community and I hope it can be final solution for handling menus.
If you have any ideas, notice any bugs, or have any ideas, you can reach me at ryan [at] thatsquality.com.
A bug tracker is available at http://redmine.sympalphp.org/projects/io-menu
This plugin was taken from sympal CMF and was developed by both Ryan Weaver and Jon Wage.
