繁体   English   中英

Codigniter:我不想在登录页面上加载模板的 header 和页脚部分

[英]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);
}

你可以试试下面的步骤。

  1. 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.

  2. 如果代码不存在,则编写逻辑以通过传递一些参数来跳过 header 和页脚文件。

  3. 否则注释$this->render('login', $head, $data); 代码并添加以下代码。

    $this->load->view('login', $data);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM