如何在没有编辑权限的情况下列出杂货库中的所有数据


How list all data in grocery crud without edit permission?

我有这样的代码

$crud->columns('a','b','c','d');
$crud->unset_add();
$crud->unset_edit();
$crud->unset_delete();

现在a,b,c,d在网格中显示。但是表中总共有20个字段。因此,不可能在网格中显示所有字段。我怎样才能在杂货杂货中显示所有数据?

可以显示表$crud->set_table('table_name');

中的所有列
    public function employees_example()
{
    $crud = new grocery_CRUD();
    $crud->set_table('employees');
    $crud->unset_add();
    $crud->unset_edit();
    $crud->unset_delete();
    $output = $crud->render();
    $this->_example_output($output);                
}
function _example_output($output = null)
{
    $this->load->view('our_template.php',$output);    
}

Just do:

$crud->unset_add();
$crud->unset_edit();
$crud->unset_delete();

没有$crud->columns,它应该像预期的那样为你工作。

你可以用

$crud->unset_operations(); //This is a shortcut to undet_add/edit/delete

更多信息请查看:http://www.grocerycrud.com/documentation/options_functions/unset_operations

相关文章: