[eluser]Mark van der Walle[/eluser]
The library also blurs the line between controller and view, where the view is responsible for showing data and how something is showed and the controller which should gather and process data and pass them between different parts of the application.
Also the example used a <br /> tag in the function (if im not mistaken). What if my output can change from html to xml, plain text or some other format. With "normal" Controller/View seperation my controller can just load a different view and presto! i have a different format.
CodeIgniter allows the blur between seperate parts of the application. Hell I can even do:
Code:
class Example extends Controller
{
function index()
{
$users = $this->db->query('SELECT * FROM `users`');
foreach ($users->result() as $row) {
echo $row->username . '<br />';
}
}
}
The separation of the different parts allows for better isolation of problems, responsibilities, code reuse, adding extra features and much much more that does not currently come to mind.