88,190 Installs and Counting! Get Sparks Now!
Hey! Keep up to date with the project through its beta and public launch by following @getsparks.
Tweet
A Quick Looks At Sparks (EllisLab Official Post)
March 11, 2012
from: codeigniter.com
The Top Sparks of 2011
December 31, 2011
from: codefury.net
CodeIgniter Starter Project − A Starting Point for Any CI Dev
December 12, 2011
from: github.com
NetTuts+ Tutorial for GetSparks
November 24, 2011
from: net.tutsplus.com
The Menu library is used to create hierarchical html structures ideal for menu structures.
| Contributor | : Barnabas |
| : Log in to view | |
| Author Website | : http://bkendall.biz/ |
| Spark Website | : https://github.com/Barnabas/Spark-Menu |
| Repository Type | : git |
| Number of Installs | : 624 |
php tools/spark install -v1.0.0 menu
Or download this version manually:
Get menu-1.0.0.zip
The Menu library is used to create hierchical html structures ideal for menu structures. It is adapted from the menu class found in FUEL CMS but redistributed here according to the license.
This library is capable of outputting standard collapsable menus with helper classes for drop-down or vertical navigation, as well as breadcrumbs and page titles. More complete documentation can be found in the FUEL CMS user guide, but here is a brief overview.
To create a menu, you must populate an array with the menu items. Then you can output structured HTML suitable for standard navigation by calling the render method. Here's an example:
$this->load->spark('menu/0.0.1');
$nav = array();
$nav['about'] = 'About';
$nav['about/history'] = array('label' => 'History', 'parent_id' => 'about');
$nav['about/contact'] = array('label' => 'Contact', 'parent_id' => 'about');
$nav['products'] = 'Products';
$nav['products/X3000'] = array('label' => 'X3000', 'parent_id' => 'products');
$active = 'about/history';
$menu = $this->menu->render($nav, $active, NULL, 'basic');
echo $menu;
/* echoed output looks something like this
<ul>
<li class="first active"><a href="/about" title="About">About</a>
<ul>
<li class="first"><a href="/about/history" title="History">History</a></li>
<li class="last active"><a href="/about/contact" title="Contact">Contact</a></li>
</ul>
</li>
<li class="last"><a href="/products" title="Products">Products</a></li>
</ul>
*/
The menu array can hav the following key/value pairs: