⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Call to undefined method App\Libraries\GroceryCrud::set_relation()



ajith1028
  • profile picture
  • Member

Posted 07 April 2021 - 19:18 PM

  $crud = new GroceryCrud();
        $crud->setTable('departments'); 
        $crud->columns(['depname','dep_head','bld','flr','ext','email','comp_id']);
        $crud->set_relation('comp_id','company_login','cname');  
        $crud->displayAs('depname','Department')->displayAs('dep_head','Department Head') -> displayAs('bld','Building')->displayAs('flr','Floor')->displayAs('ext','Extension') ->displayAs('email','Department email') ->displayAs('comp_id','Company');
        $output = $crud->render();
        return $this->_exampleOutput($output);

 

 

Can anyone help me to solve this issue.

 

Error is appearing in this line

 $crud->set_relation('comp_id','company_login','cname'); 

 

 

table structure attached

 

Thanks

Aj


ajith1028
  • profile picture
  • Member

Posted 08 April 2021 - 06:56 AM

Solved

 

$crud->set_relation('comp_id','company_login','cname'); 

 

it is $crud->setRelation('comp_id','company_login','cname');