sfMilonicPlugin
The sfMilonicCPlugin is a symfony plugin that provides easy-to-use drop-down menus based on Milonic Menus (www.milonic.com).
Installation
- Install the plugin
symfony plugin-install http://plugins.symfony-project.com/sfMilonicPlugin
- To use a Milonic Menu, you need to create a menu.yml file in your app config folder. The plugin includes a example menu file (menu_example.yml) for sfGuardPlugins Modules. This example shows how to set menu styles, menus, items and submenus. You can set multiples menus for your app.
- Finally, set the environment config handler for menu.yml in config_handlers.yml. The plugin includes a config_hanlder.yml file. Copy this file in
your app config folder.
config/menu.yml: class: sfDefineEnvironmentConfigHandler param: prefix: mm_
- To Show a Menu in your app follow this steps:
- set Milonic Helper
<?php use_helper('Milonic'); ?> - Set common milonic options. you can put this in Page Headers options, after milonic helper call.
<?php echo milonic_options(); ?>
- Retrieve menus array from sfConfig vars.
<?php $menus = sfConfig::get("mm_milonic_menus");?> - To show an specific menu, uses milonic_menu helper function, passing menu name.
<?php echo milonic_menu($menus['myMenu']); ?>
- set Milonic Helper
- The best place to put the menu.
I recommend to put the menu in app layout. If app has user access control, you can set your layout to show the menu to authenticated users only.
<?php if ($sf_user->isAuthenticated()) {echo milonic_menu($menus['myMenu']);} ?>
- Full example:
<?php if ($sf_user->isAuthenticated()):?> <?php use_helper('Milonic'); ?> <?php echo milonic_options(); ?> <?php $menus = sfConfig::get('mm_milonic_menus'); ?> <?php echo milonic_menu($menus['access']); ?> <?php endif; ?>
- Milonic Documentation.
- For styles options: http://www.milonic.com/styleproperties.php
- For Menu options: http://www.milonic.com/menuproperties.php
- for items options: http://www.milonic.com/itemproperties.php
- Notes: Milonic isn't a free software, please read license and use policy in Milonic Web Site.
1.0.1 Version
- Support Javascript function at url field
url: function: setFrame params : { link: dependencias/ } - Minor bug with directory separator. Thanks nervo.net
Attachments
- sfMilonicPlugin-1.0.0.tgz (27.5 kB) - added by BorisDuin on 05/18/07 20:43:13.
- sfMilonicPlugin-1.0.1.tgz (27.6 kB) - added by BorisDuin on 06/09/07 00:23:40.