lonnieezell / Bonfire2

CodeIgniter 4-based application skeleton
MIT License
129 stars 50 forks source link

Menu Ordering not working properly #376

Closed krishna-gujjjar closed 1 year ago

krishna-gujjjar commented 1 year ago

I tried $menuWeight in the app/config/Bonfire.php also weight of MenuItem in the modules/Base/Module.php, but nothing working to ordering it.

I want the menu order:

Here is the screenshot:

app/config/Bonfire.php

Screenshot 2023-08-07 at 9 18 52 AM

am i missing something?

dgvirtual commented 1 year ago

Are user_list and other keys in your array named routes? The User List's named route should be user-list (see src/Users/Config/Routes.php):

// Manage Users
$routes->match(['get', 'post'], 'users', 'UserController::list', ['as' => 'user-list']);
krishna-gujjjar commented 1 year ago

@dgvirtual Yes, there exist all of those named routes in there module's Route Config file.

dgvirtual commented 1 year ago

Ok, so, they all contain dashes, not undescores. But you use underscores in $menuWeights property

krishna-gujjjar commented 1 year ago

Ok, so, they all contain dashes, not undescores. But you use underscores in $menuWeights property

Oops, Old habit of mine. I am mostly use underscores rather than dash. I replaced routes alias with underscores and it working fine.

Thanks man!