[英]Grocery crud hidden field and set relation didnt work together
I have a problem with grocery crud hidden field and set relation . 我对杂货杂货隐藏字段和设置关系有疑问。
My code is 我的代码是
$crud->set_relation('created_by','users','user_name');
$crud->edit_fields('title', 'description', 'created_by');
$crud->change_field_type('created_by', 'hidden', $this->user_id);
Here i want to store user_id as created by in hidden form. 在这里,我要存储以隐藏形式创建的user_id。 But problem is that created_by field is still visible in my view page.
但是问题是在我的视图页面中created_by字段仍然可见。 when I cut off set_relation then created_by field is hidden.
当我切断set_relation时,created_by字段被隐藏。 What's problem ?
什么问题 ? plz help me
请帮我
$state = $crud->getState();
if ($state === 'list') {
$crud->set_relation('created_by','users','user_name');
}
$crud->edit_fields('title', 'description', 'created_by');
$crud->change_field_type('created_by', 'hidden', $this->user_id);
Use the below coding 使用下面的编码
$crud->change_field_type('created_by', 'hidden', $this->user_id);
to 至
$crud->field_type('created_by', 'hidden', $this->user_id);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.