⚠ 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

grocery config



maha
  • profile picture
  • Member

Posted 11 December 2012 - 11:59 AM

in grocery_crud config

$config['grocery_crud_default_language'] = 'english';


when I replace "english " with lang('var')
it doesn't work

can anyone help me please?

victor
  • profile picture
  • Member

Posted 11 December 2012 - 22:22 PM

Show your code please.

maha
  • profile picture
  • Member

Posted 12 December 2012 - 12:32 PM

in grocry crud config

$config['grocery_crud_default_language'] = 'lang(lang)';

victor
  • profile picture
  • Member

Posted 12 December 2012 - 12:33 PM

what is "lang(lang)"?
Is it function?

maha
  • profile picture
  • Member

Posted 12 December 2012 - 12:35 PM

now i have new problem
field_type not working
there is my code

$crud->fields('name','img_url','art_id');
$crud->field_type('art_id', 'hidden',$artid);


any help

maha
  • profile picture
  • Member

Posted 12 December 2012 - 12:37 PM

[quote name='victor' timestamp='1355315616' post='4657']
what is "lang(lang)"?
Is it function?
[/quote]

no it's language variable in language files

victor
  • profile picture
  • Member

Posted 12 December 2012 - 12:40 PM

$config['grocery_crud_default_language'] = "your_language"
"your_language" - is file name with your language

victor
  • profile picture
  • Member

Posted 12 December 2012 - 12:45 PM

[quote name='maha' timestamp='1355315728' post='4658']
now i have new problem
field_type not working
there is my code

$crud->fields('name','img_url','art_id');
$crud->field_type('art_id', 'hidden',$artid);


any help
[/quote]

what error do you have? or this field hasn't value?

maha
  • profile picture
  • Member

Posted 12 December 2012 - 12:46 PM

[quote name='victor' timestamp='1355316034' post='4660']
$config['grocery_crud_default_language'] = "your_language"
"your_language" - is file name with your language
[/quote]
ok fixed this point thank you very much
now the field_type() not workes.

victor
  • profile picture
  • Member

Posted 12 December 2012 - 12:47 PM

what error do you have? or this field hasn't value?

maha
  • profile picture
  • Member

Posted 12 December 2012 - 12:47 PM

the error
[b]Fatal error[/b]: Call to undefined method grocery_CRUD::field_type()

victor
  • profile picture
  • Member

Posted 12 December 2012 - 12:50 PM

what version of the GC do you use?

maha
  • profile picture
  • Member

Posted 12 December 2012 - 12:52 PM

1.2

victor
  • profile picture
  • Member

Posted 12 December 2012 - 12:58 PM

field_type: Available for version >= 1.2.3
Try use the "change_field_type"
$crud->change_field_type('art_id', 'hidden',$artid);

maha
  • profile picture
  • Member

Posted 12 December 2012 - 13:07 PM

i tried it now the error fixed but ihave a logic error

i have a field art_id i don't want to appear it in add form but i need it as i add files to this art_id

please help

maha
  • profile picture
  • Member

Posted 12 December 2012 - 13:10 PM

this is my code

$crud->set_table('art_files');
$crud->where("art_id = $artid");
$crud->columns('art_id','name','file_url');
$crud->fields('name','file_url','art_id');
$crud->change_field_type('art_id', 'hidden',$artid);


$artid is avariable posted

victor
  • profile picture
  • Member

Posted 12 December 2012 - 13:12 PM

Do you want to upload files when adding a record?

maha
  • profile picture
  • Member

Posted 12 December 2012 - 13:15 PM

yes

maha
  • profile picture
  • Member

Posted 12 December 2012 - 13:16 PM


$crud->set_field_upload('file_url', 'assets/uploads/');

maha
  • profile picture
  • Member

Posted 12 December 2012 - 13:16 PM

the files inserted in the database but with art_id =0