[eluser]Buso[/eluser]
Hi guys, I was building a blog with codeIgniter but I don't know enough about how I should distribute the responsibilities.
Where do you think I should process the query results?? For example, if I get 1 article as result, should I do something like this in the controller?:
// PAGE DATA
$row = array_shift($this->blogmodel->getLastArticle()); // *
$article_data['title'] = $row['title'];
$article_data['body'] = $row['body'];
[...]
// PAGE STRUCTURE
$data['header'] = ...
$data['content'] = $this->load->view('blog/article',$article_data,true)
$data['footer'] = ...
[...]
// PUT ALL TOGETHER INTO THE LAYOUT
$this->load->view('layout',$data);
*Maybe I could use $article_data instead of $row and avoid the assignations, whatever
It was pretty clean till I had to do the same with the comments, where there could be 50 of them or more, each one with its respective html tags (no point of doing that in the Controller).
But I wanted to be consistent, so.. maybe you could gimme some advices about this, or link me to something to read??
Thanks in advance ^^