⚠ In case you've missed it we are migrating 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 forum is read-only and soon will be archived. ⚠


ajith1028

Member Since 31 Mar 2021
Offline Last Active Apr 09 2021 05:24 PM
-----

Topics I've Started

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

07 April 2021 - 07: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