Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fuel LbMenu Package
  • Hi,

    I present my new package : Fuel LbMenu Package

    It's a package for managing easily menus in FuelPHP

    Features : 

    * Db Driver (with Orm Nestedset)
    * Array Driver (with same features as Db Driver)
    * Create your own driver

    * Infinite level in your menu
    * Use route for your link
    * Use EAV Attribute in your HTML menu
    * Multiple theme (default, boostrap, ..) with complete customization. Each menu can uses separatly a theme.
    * Multilanguage menu

    * Tasks for managing easily menu on Db Driver



    I've also create a module for managing menu on Db Driver with UI : https://github.com/jhuriez/fuel-module-menu

    All feedback / fork are welcome :-)

    Some screenshots of the module :


  • Hi
    I could not I use it in my project. I install it. But I can not. Please guide.
  • Hi,

    I have write a guide on the github repo. If you have error, create a pull request on the repo please
  • Can you give me a sample?
  • What do you want to use ? only package or package+module ?

    Where are you blocked in the installation ? 

    I'have wrote a guide in the readme here : https://github.com/jhuriez/fuel-lbMenu-package
  • how in work in blog in package
  • Would be nice if you could add a field to the table end editors for the Fontawesome etc; Icons
  • Seems to be very good. I was working on something similar. Would you mind if I PR some features? I would probably discontinue my package and commit the few features to yours.
  • KoolCoder > You can use EAV attribute 

    sagikazarmark > Thanks, and yes no problem :-) !

    fstarlike > You need to install the package (read the guideline). But if you want to manage your menu, you need to create your own backend, or install the module (read the guideline too)
  • Thank you sir.
    I wish you a nice day
  • hi
    sory sory

    How can I make a menu or sub-menu using php commands?

    For example,
    php oil refine menu:create --packages=lbMenu "admin"

    The above code for CMD but the code is suitable for use in PHP?
  • Hi,

    In PHP for create a menu (or sub), i do this : 

            $menu = \LbMenu\Helper_Menu::forge();
            \LbMenu\Helper_Menu::manage($menu, $params);

    $params is an array which contains all attributes, you can see an example in the package : lbMenu/tasks/menu.php at line 51 function create()

            $params = array(
                'slug' => \Cli::option('slug', $text),
                'link' => \Cli::option('link', '#'),
                'is_blank' => \Cli::option('is_blank', false),
                'theme' => \Cli::option('theme', \Config::get('menu.theme_default')),
                'use_router' => \Cli::option('use_router', false),
                'named_params' => $namedParamsArr,
                'language' => \Cli::option('language', \Config::get('language')),
                'title' => \Cli::option('title', ''),
                'text' => $text,
                'small_desc' => \Cli::option('small_desc', ''),
                'eav' => $eavArr,
                'parent_id' => $parent_id,
            );
  • Or you can see other examples in my module which manage the lbMenu package.
  • thank u very much.
    AND  Another question :
    For example,
    I have a sub menu with fruits like apples and oranges and bananas branches of the menu.
    Well I got the banana details how I got to the main menu, the same menu I would get the fruit.
    It was in a lot of possible menu and submenu.
    The contrary showcategoryTree

  • hi
    i have a question
    \LbMenu\Helper_Menu::forge()->render();

    If you want the default theme is the default theme like the one I use, what should I do bootstrp-2.
  • This looks great! I'm feeling so bad I wasted more than 10 hours yesterday and today just to create a function to get a simple HTML tree list out of a Nested set.

    Thanks for the great solution.
  • Thanks ! You can view how i construct the tree list here : lbMenu/classes/menu/db.php :-)
  • fstarlike >

    Yes ->render() will use the default theme. If you want to use another theme you can do :
    $menu = \LbMenu\Helper_Menu::find('my-slug-menu');
    $menu->render('bootstrap-2');
  • thanks , Syntaxlb

    I could use the module I need module too.
    Because
    ErrorException [ Fatal Error ]: Class '\Backend\Controller_Backend' not found.

    I do not know exactly what to do
  • Look the readme for this error. 

    - ErrorException [ Fatal Error ]: Class '\Backend\Controller_Backend' not found.
    It's because the controller \Menu\Controller_Backend need to extends your admin controller in your project. In my case, the admin controller is named \Backend\Controller_Backend

    You need to adapt for your project
  • Sorry Syntaxlb
    Can you
    tell me exactly what to do?
    Do I need to change the module or do I have to change my project?
  • \Menu\Controller_Backend need to extends your Backend (or Admin) controller.


    2 solutions :

    Solution One : 

    Your backend controller need to be named "\Backend\Controller_Backend" (you need to have a module "backend" OR use namespace "Backend")

    Solution Two : 

    For example, your backend controller is \Controller_Admin (in classes/controller/admin.php)

    Just edit in \Menu\Controller_Backend (in modules/menu/classes/controller/backend.php) the controller to extends. For my example it's :

    class Controller_Backend extends \Controller_Admin
    instead of
    class Controller_Backend extends \Backend\Controller_Backend

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion