[eluser]Bacteria Man[/eluser]
I'm using a controller->library->model structure. The controller is extremely thin and is responsible for only displaying the view. The library contains all the business logic and the model interacts with the database.
With the above in mind, I'm trying to determine the best practice of exposing data to a view.
The most obvious way is to pass the data in the second parameter. For example:
Code:
$data['title'] = 'My Blog';
$this->load->view('blogview', $data);
What about data produced by the library? I like to return true/false from my functions. If false, the function failed for whatever reason. If true, the data is defined as an object and available to the view.
I suspect that a combination of both techniques is acceptable.
I'd appreciate any comments and/or a confirmation.
Thanks!