function customers_management()
{
$crud = new grocery_CRUD();
$crud->set_table('customers');
$crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','postalCode');
$crud->display_as('salesRepEmployeeNumber','from Employeer')
->display_as('customerName','Name')
->display_as('contactLastName','Last Name');
$crud->set_subject('Customer');
$crud->set_relation('salesRepEmployeeNumber','employees','lastName');
$output = $crud->render();
$this->_example_output($output);
}
这是控制器的功能。 我需要添加什么来检查登录信息?
答案 0 :(得分:0)
您应该查看其他库(如DX_Auth等),这些库负责身份验证并在操作的第一行进行调用。
function customers_management() {
<call the authentication library>
if (success-login) {
... do authenticated operation
} else {
... show him the login page
}
}