<?php
// controllers/example.php içeriği
class Example extends CI_Controller
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$data['view'] = 'category/index';
$data['text'] = 'Hello wolrd';
$this->load->view('index', $data);
}
}
?>
<?php
// views/index.php içeriği
$this->load->view('sections/header');
$this->load->view($view);
$this->load->view('sections/footer');
?>
<?php
// views/category/index.php içeriği
echo $text;
?>Ben nettutstaki derslerden yararlandığım için oradan öğrendiğim yapıya alıştım ve sürekli bunu kullanıyorum.