Welcome Guest, Not a member yet? Register   Sign In
Higher Order PHP: Map and Functional Extension Helper
#16

[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.


Messages In This Thread
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-09-2008, 08:30 PM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 12:13 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 12:21 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 12:31 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 12:32 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 12:33 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 12:37 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 01:20 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 01:36 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 02:45 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 02:46 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 03:21 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 03:32 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 03:34 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 03:56 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 07:59 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 08:19 AM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 07:26 PM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 07:34 PM
Higher Order PHP: Map and Functional Extension Helper - by El Forum - 09-10-2008, 07:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB