, , (, <ul>, <div> - ), - , , .
CodeIgniter, Model, View, Controller, "sidebar.php" Header, , :
<html>
<head>.......</head>
<div id="header">....</div>
<?php $this->load->view('sidebar');?>
The sidebar window contains the logic for displaying menu items. This is usually a static menu, but if it was dynamic and had to be retrieved from the database, I would do the following:
<ul>
<?php
$items=$this->some_model->getMenuItems();
foreach ($items as $item):
?>
<li><a href="<?=$item['url'];?>"><?=$item['text'];?></li>
<?php endforeach;?>
</ul>
source
share