Next, I've already reviewed this community and got some nice fonts but it did not help me, I'm trying to separate my links by categories that are also stored in the database.
If someone has a tutorial to thank me for.
See the prints below
1st print category table 2ndprintlinktable 3rdprinthomepageofthesite
Asyoucanseeinthethirdimage,itisnotseparatingbycategoriesisatremendousmess,nowlet'sthecodes:
Mymodel:
<?phpclassDocs_ModelextendsModel{publicfunction__construct(){parent::__construct();}publicfunctiongetCategories(){return$this->_db->read('SELECT*FROM'.DATABASE_PREFIX.'cats',array());}publicfunctiongetDocsCategories(){$data=$this->getCategories();$arr=[];foreach($dataas$value){$arr=$value;}//return$this->_db->read('SELECT*FROM'.DATABASE_PREFIX.'docsWHEREid_cat=:id',array(//':id'=>$arr['id_cat']//));return$this->_db->read('SELECT*FROM'.DATABASE_PREFIX.'docsc1,'.DATABASE_PREFIX.'docsc2WHEREc1.id_cat=1ANDc1.id_cat=c2.id_cat',array(//':idcat'=>$arr['id_cat']));}}
Myview:
<sectionclass="section">
<div class="container">
<div class="row">
<div class="col-md-3">
<?php foreach($data['cats'] as $key => $value): ?>
<div class="panel panel-default">
<div class="panel-heading"><?php echo $value['title'] ?></div>
<div class="list-group">
<?php foreach($data['docs'] as $key2 => $value2): ?>
<a href="#" class="list-group-item"><?php echo $value2['title'] ?></a>
<?php endforeach; ?>
</div>
</div>
<?php endforeach; ?>
</div>
If you need more information I'll be happy to help.