为什么我得到“不能修改已经由registration_model发送的头信息头” codeigniter中的错误? [英] Why I'm getting "cannot modify header information headers already sent by registration_model" error in codeigniter?

查看:117
本文介绍了为什么我得到“不能修改已经由registration_model发送的头信息头” codeigniter中的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的codeigniter应用程序的模型有一个问题。我收到此错误的发送标题信息。基本上,codeigniter抱怨我的注册模型发送头信息之前的任何东西。这怎么可能?我认为模型只用于持有数据库查询方法,没有更多。有人可以向我解释一下吗?

I have a problem with model in my codeigniter app. I'm getting this error of sending headers information. Basically, codeigniter is complaining about my registration model sending header information before anything else. How is it possible? I thought that models are only for holding db queries methods and nothing more. Can someone please explain me that?

这是控制器开头的样子:

This is how the beginning of a controller looks like:

function User()
{
    parent::Controller();
    $this->view_data['base_url'] = base_url();
    $this->load->model('User_registration_model');       // don't forget capital, it's important
    $this->load->model('user_map_model');                // don't forget capital, it's important
    $this->load->model('Tribe_model');                   // don't forget capital, it's important
    $this->load->library('email');                       // Loading email library
    $this->load->library('session');                     // sets up the session
    $this->load->library ('form_validation');            // Loading form validation library
    $this->load->helper(array('form', 'url'));  
}


推荐答案

之前 。确保在标题函数之前没有代码/ html或空格/缩进,并且在第一次打开php标记<?php 之前没有任何内容以及结束标记?>

Note that headers should be sent before anything else. Make sure that there is no code/html or even space/indentation before the header function and there is nothing before the first opening php tag <?php as well as ending tag ?> in your view.

这篇关于为什么我得到“不能修改已经由registration_model发送的头信息头” codeigniter中的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆