Не подгружается footer на странице рейтинг фильмов. что делать?
1
конструктор Rating.php :
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Rating extends CI_Controller {
public function __construct() {
parent::__construct();
}
public function index() {
$this->data['title'] = "Рейтинг фильмов";
$this->load->model('Films_model');
$this->data['films'] = $this->Films_model->getFilmsByRating(10);
$this->load->view('templates/header', $this->data);
$this->load->view('rating/index', $this->data);
$this->load->view('templates/footer');
}
}
вид :
<h1><?php echo $title; ?></h1>
<hr>
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>Фильм</th>
<th class="text-center">Год</th>
<th class="text-center">Рейтинг</th>
</tr>
</thead>
<tbody>
<?php foreach ($films as $key => $value): ?>
<tr>
<td class="col-lg-1 col-md-1 col-xs-2">
<img class="img-responsive img-thumbnail" src="<?php echo $value['poster']; ?>" alt="<?php echo $value['name']; ?>">
</td>
<td class="vert-align"><a href="show.html"><?php echo $value['name']; ?></a></td>
<td class="text-center vert-align"><?php echo $value['year']; ?></td>
<td class="text-center vert-align"><span class="badge"><?php echo $value['rating']; ?></span></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
модель используется старая Films_model.php :
public function getFilmsByRating($limit) {
$query = $this->db
->order_by('rating', 'desc')
->where('category_id', 1)
->where('rating>', 0)
->limit($limit)
->get('movie');
return $query->result_array();
}
при выводе пишет ошибку что не знает переменную news из футера :
</div>
<?php $this->load->view('templates/menu', $news, $films); ?>
</div>
</div>
<div class="clear"></div>
</div>
<footer>
<div class="container">
<p class="text-center"> <a href="http://ru.wh-db.com">WH-DB.COM</a> </p>
</div>
</footer>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/assets/js/bootstrap.min.js"></script>
</body>
</html>
<!-- Footer end -->
что делать?