⚠ 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

Chain relations (set_relation)



DrParanoia
  • profile picture
  • Member

Posted 10 October 2012 - 10:53 AM

Hi everyone!

I am new to Grocery CRUD, and i can't figure out one thing:

I have 3 tables "Person", "Houses", "Streets".

So a Person is connected to a House and House is connected to a Street.

Person:
id
name
house_id

Houses:
id
house_nr
street_id

Streets:
id
name
region_id


$this->grocery_crud->set_table('Person');
$this->grocery_crud->set_relation('house_id','Houses','{street_id} ({house_nr})');


When adding a person how can i display Streets.name instead of Houses.street_id?

I am really desperate :/ Thanx in advance!

victor
  • profile picture
  • Member

Posted 10 October 2012 - 12:35 PM

maybe it will help you : http://www.grocerycrud.com/documentation/options_functions/callback_field