⚠ 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

Write in the relation table



bitisuvanje
  • profile picture
  • Member

Posted 25 January 2012 - 12:59 PM

Am new in PHP and CI. Just get the grocery CRUD.

Having the attached situation, when writing in categories, how can I write the names in categories_t table for every language code in languages table.

http://imgur.com/tu5AV

Thanks for the time

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 25 January 2012 - 19:04 PM

This is just a simple set_relation. You can see the example at: http://www.grocerycr.../set_a_relation I also show, how you can use it.

In your case it will be:

$crud->set_table('categories_t');
$crud->set_relation('language_id','languages','code');
$crud->set_relation('category_id','categories','picture');

AdamCI
  • profile picture
  • Member

Posted 26 January 2012 - 10:48 AM

Sorry for the misunderstanding. I like to write in categories.

So the entry form would be like this:

[indent=1]Enter new category (category_id has the auto_increment option):[/indent]

[indent=1]Name: name_in_english (languages->name) [code (languages->code)] - en[/indent]
[indent=1]Name: name_in_albanian (languages->name) [code (languages->code)] -sq[/indent]
[indent=1]Picture: url_to_the_picture[/indent]

[indent=1]After this I would have new categories row, and two new categories_t rows.[/indent]

Thank you,
Adam

dev.mwh
  • profile picture
  • Member

Posted 03 April 2012 - 22:01 PM

[quote name='AdamCI' timestamp='1327574909' post='364']
Sorry for the misunderstanding. I like to write in categories.

So the entry form would be like this:

[indent=1]Enter new category (category_id has the auto_increment option):[/indent]

[indent=1]Name: name_in_english (languages->name) [code (languages->code)] - en[/indent]
[indent=1]Name: name_in_albanian (languages->name) [code (languages->code)] -sq[/indent]
[indent=1]Picture: url_to_the_picture[/indent]

[indent=1]After this I would have new categories row, and two new categories_t rows.[/indent]

Thank you,
Adam
[/quote]

I have the same problem,

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 04 April 2012 - 06:32 AM

I am sorry but grocery CRUD still not support multilingual-functionality. You have to change the core of grocery CRUD to do something like this.