0

Link to my page where grocery CRUD instance is, for example index.php/users.

When I add a new user, URL of the form is index.php/users/index/add, and I use link from external page, that points directly to http://domain.com/index.php/users/index/add to add new user without displaying the CRUD table first.

Now, I would like to set some default value via GET, for example index.php/users/index/add?foo=bar, and set some field's default value to bar if $_GET['foo'] is set.

How can I achieve this?

jOpacic
  • 9,453
  • 12
  • 36
  • 58

1 Answers1

0

Well, if you'd like to combine get with this $crud->field_type('office_id', 'hidden', $office_id);

Which in this example:
office_id is the field,
hidden is the parameter so editor can't edit this field,
$office_id is the passed parameter(variable)

This way, office_id field will be always $office_id (which can you change)

Henry J
  • 344
  • 2
  • 4
  • 14