CodeIgniter Forums
Help Create sub menu from database! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Help Create sub menu from database! (/showthread.php?tid=53863)

Pages: 1 2


Help Create sub menu from database! - El Forum - 08-13-2012

[eluser]InsiteFX[/eluser]
Well I have create a library and everything out of that script that works just fine.

Or you can go buy this one and convert it over to CI which I have also done along with the Easy Menu on that site.

Advanced Menu Manager System



Help Create sub menu from database! - El Forum - 08-13-2012

[eluser]uqmeebi[/eluser]
[quote author="InsiteFX" date="1344880882"]Well I have create a library and everything out of that script that works just fine.

Or you can go buy this one and convert it over to CI which I have also done along with the Easy Menu on that site.

Advanced Menu Manager System
[/quote]

And what is means?
where is your library? if you don't help do not pollute this Topic
reason is not money. but the fact that I want to do it by hand.


Help Create sub menu from database! - El Forum - 08-13-2012

[eluser]InsiteFX[/eluser]
Well if you searched the forums you would find and old version of it.




Help Create sub menu from database! - El Forum - 08-13-2012

[eluser]uqmeebi[/eluser]
[quote author="InsiteFX" date="1344884359"]Well if you searched the forums you would find and old version of it.

[/quote]

ok thx.
yes i know this it's hire but you database is very hard.


Help Create sub menu from database! - El Forum - 08-13-2012

[eluser]InsiteFX[/eluser]
You do not need all the fields that are in the database table. Most are for a CMS using HMVC.



Help Create sub menu from database! - El Forum - 08-13-2012

[eluser]skunkbad[/eluser]
Community Auth features a "Category Menu" that displays a menu from database table. It alloes for unlimited sub-categories.


Help Create sub menu from database! - El Forum - 08-13-2012

[eluser]Egill Th[/eluser]
[quote author="uqmeebi" date="1344877271"][quote author="Egill Th" date="1344854984"]I'm not sure what you're asking for but to my understanding you are looking for something like this.

There may be some errors but it should work in theory.

controller
Code:
<?php
class Item extends CI_Controller {
  var $data;

  public function __construct() {
    $this->load->model('itemmodel');

  public function showMenu() {
    $this->data['items'] = $this->itemmodel->getItems();
    
    foreach ( $this->data['items'] as $item ) {
      $this->data['sub_items'][$item->id] = $this->itemmodel->getSubItems($item->id);
    }

    $this->load->view('itemview.php', $this->data);
}

view
Code:
<?php
foreach ( $items as $item ) {
  echo $item->name;

  foreach ( $sub_items[$item->id] as $sub_item ) {
    echo $sub_item->name;
  }
}
[/quote]

please create full MVC script for visualization.[/quote]

All that bit of code is lacking is the model and I have no idea how you intend to have your database set up.


Help Create sub menu from database! - El Forum - 08-16-2012

[eluser]uqmeebi[/eluser]
thx all for you time = )