I was coding PHP using controll based on adress and GET method with index.php?site=filename. Then i was including existing filename.php in content div. That was simply but effective. Also i has got notification div where i included file with data from database
I'm trying to get similar result in CodeIgniter
html
head
/head
body
div notification bar (always on top like Material)
div menu (slide from left also like Material)
div content (depended on controller and loaded view)
div footer (only /body /html)
/body
/html
by
public function __construct()
{
parent::__construct();
$this -> load -> view('notification ');
$this -> load -> view('menu ');
}
I want do send data from model to notification view but i can't do this in constructor. Also i dont want to load this same view in each controller's method. How should i do this? I dont expct ready solution, but some ideas, maybe pseudocode?
Or maybe this is only one solution like this? Loading all needed views in every methods? Really?
class news extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this -> load -> view('header');
}
public function index()
{
[...]//data from model
$this -> load -> view('notification',$Data);
$this -> load -> view('menu',$Permission);
$this -> load -> view('news',$Content);
}
[...]