Welcome Guest, Not a member yet? Register   Sign In
Passing controller object into view (Is this bad?)
#1

[eluser]blasto333[/eluser]
I have a view that is used by two controllers both which implement a common interface.



In the controllers here is how I load the view.

Customers controller (implements iPersonController)
Code:
function index()
{
    $data['controller_name']=strtolower(get_class());
    $data['controller']=$this;
    $data['manage_table']=get_people_manage_table($this->Customer->get_all(),$this);
    $this->load->view('people/manage',$data);
}


manage view snippet
Code:
<?php echo anchor("$controller_name/view/-1/width:".$controller->_get_form_width().'/height:'.$controller->_get_form_height(),"New");
?>


Is it a bad practice to send in a reference to a controller, when I have a legit reason to be doing so.
($controller->_get_form_width())


Messages In This Thread
Passing controller object into view (Is this bad?) - by El Forum - 10-17-2008, 10:57 PM
Passing controller object into view (Is this bad?) - by El Forum - 10-18-2008, 01:27 AM
Passing controller object into view (Is this bad?) - by El Forum - 10-18-2008, 06:22 AM
Passing controller object into view (Is this bad?) - by El Forum - 10-18-2008, 09:38 AM
Passing controller object into view (Is this bad?) - by El Forum - 10-18-2008, 09:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB