⚠ 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. Very soon this forum will be read-only and archived. ⚠


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

set_relation

  • Please log in to reply
1 reply to this topic

#1 ajith1028

ajith1028

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 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

Attached Thumbnails

  • two tables.jpg


#2 ajith1028

ajith1028

    Newbie

  • Members
  • Pip
  • 2 posts

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'); 







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users