简体   繁体   中英

Codigniter: I don't want to load the header and footer part of my template on the login page

This is my login controller

in my login page i haven't need to loaded header and footer part

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);
}

Can you try below steps.

  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. If code doesn't exists to do so write logic to skip header and footer files by passing some parameters.

  3. Otherwise comment $this->render('login', $head, $data); code and add below code.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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