[英]Codigniter: I don't want to load the header and footer part of my template on the login page
这是我的登录 controller
在我的登录页面中,我不需要加载 header 和页脚部分
public function login()
{
$head = array();
$data = array();
$head['title'] = lang('user_login');
$head['description'] = lang('user_login');
$head['keywords'] = str_replace(" ", ",", $head['title']);
$this->load->library('user_agent');
$referrer = $this->agent->referrer();
$this->session->set_userdata('login_redirection_page',$referrer);
$this->render('login', $head, $data);
}
你可以试试下面的步骤。
Go to render function definition and verify how they are loading the header and footer files, if code exists to skip header and footer files(by passing some parameters as false or etc), proceed accordingly.
如果代码不存在,则编写逻辑以通过传递一些参数来跳过 header 和页脚文件。
否则注释$this->render('login', $head, $data);
代码并添加以下代码。
$this->load->view('login', $data);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.