Welcome Guest, Not a member yet? Register   Sign In
Multi level menu from database section table
#2

[eluser]Aljebrini[/eluser]
that's will work successfully Now Smile
take a look


Code:
Class Section Extends Model {

    private $Section = array();
    
    function Section() {
    
            parent::Model();
                        }
    function _Sections($root){
        
        $this->db->select('id,Name,Parent_ID,MenuTitle');
        $this->db->Where('Parent_ID',$root);
        $this->db->Where('IsActive','Y');
        $query = $this->db->get('sections');
        $this->Section[] = '<ul>';
        foreach ($query->result() as $row)
            {
                $this->Section[] = '<li>';
              $this->Section[] = anchor('site/section/'.$row->id,$row->Name);
              $this->_Sections($row->id);
             $this->Section[] = '</li>';
            }
        $this->Section[] = '</ul>';
        
        $query->free_result();
        return $this->Section;
    }

    
function sectionsTree(){
        
            return $this->_Sections(0);
    
    }
}


Messages In This Thread
Multi level menu from database section table - by El Forum - 03-13-2010, 03:25 AM
Multi level menu from database section table - by El Forum - 03-13-2010, 03:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB