Hy all,
I'm interested in your opinion about this topic because I don't know anything about it, but i want to do it right.
First things first. I know how PHP MVC works and played with it in CodeIgniter. That's why I prefer CodeIgniter. But I'm open for other frameworks.
I like to create some kind of CMS ( mostly to learn and experiment with ) in an framework. I've played with OpenCart in the past and I like that template system. It's got an template folder with separate things like common, checkout, module and so on.
The only thing that you have to do to render it all is the following:
$this->template = 'default/template/newsletter/newsletter.tpl';
$this->children = array(
'common/header',
'common/content_top',
'common/column_left',
'common/column_right',
'common/content_bottom',
'common/footer'
);
$this->response->setOutput($this->render());
In CodeIgniter, that would look something like this:
$this->load->view('templates/header', $data);
$this->load->view('templates/content_top', $data);
$this->load->view('templates/content_left', $data);
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/content_right', $data);
$this->load->view('templates/content_bottom', $data);
$this->load->view('templates/footer', $data);
So what I basically want is that you've got all these separate files ( header, column left, right or whatever ), and that they automatically ( like some kind of magic ) are loaded in the right place in the main template, with the right data ( the data is coming from an controller / model ).
I've read that HMVC is the right way to do this. This "extension / library" for CodeIgniter is coming back everywhere I search about this topic: codeigniter-modular-extensions-hmvc.
Also did I read something about smarty
Is using that HMVC extension or smarty the right way or should I use an whole other framework? What's your view about this?
Thank you very much in advantage
UPDATE
After some googling, Laravel also came up. It's got Blade as template engine. What do you guys think about that?