Welcome Guest, Not a member yet? Register   Sign In
Html Duplicacy
#1

[eluser]Unknown[/eluser]
Hi,
I using codeigniotor v.1.5.4 till now and thats works grt. but i needs (db->where_in) and also multiple select list box which not works in this version. so i downloaded and install the v 1.6.1. Now abobe problems are resolved but My index page duplicate the Html. I dont change any code except given instructions. (when i revert the overwrite files application back to normal. so i believe that my code should not have problems.)
if u think of any settings can do his. please let me know.

thanks advance
Kuldeep
#2

[eluser]Derek Allard[/eluser]
Hello Kuldeep, welcome to the CI forums!

Could you post a simple example of your controller? How many times are you calling $this->load->view()?

I'm moving this into application development forum for now, but if it turns out to be a bug I'll happily move it back.

Derek
#3

[eluser]TheFuzzy0ne[/eluser]
It sounds like you're calling $this->load->view() more than once.
#4

[eluser]Unknown[/eluser]
Derek,
thanks for fast reply. I cant attach the file because of big php controller file. (u hv only options for image file which is not suitable in this case either). By the way my path is
"system/application/frontend/controllers/index.php". I added the configured the project for multiple application as backend and frontend. one strange things that it dump the all html twice. (includeing header, footers, and others included parts).

I give u the some code .

class Index extends Controller {

function Index()
{
parent::Controller();

$this->load->library('session');
$this->load->model('index_model','',TRUE);

if( $this->session->userdata('lang1')) {
$this->lang->load('index', $this->session->userdata('lang1'));
}
else
{
$this->lang->load('index', 'english');
}

CODE LIES HERE iS SET THE DATA ARRAY FOR
$this->load->view('assets/main', $data);
}

OTHERE FUNCTIONS
}

One of my frnd added the some unmanaged code in this. Is it a problem. the code in the data set block

$data["form"] = array('method'=>'post','id'=>'searchm','name'=>'search');
$data["form_action"] = 'search/results';
$data['extra_head'] .= '

function check_property(val)
{
var base=document.search;
var show_newprojects = base.prop_newprojects;
if(val==1)
{
base.prop_all.checked=true;
base.prop_owner.checked=false;
base.prop_builder.checked=false;
base.prop_broker.checked=false;
if(show_newprojects)
base.prop_newprojects.checked=false;
}
if(val==2)
{
if(base.prop_owner.checked && base.prop_builder.checked && base.prop_broker.checked && (!show_newprojects || (show_newprojects && base.prop_newprojects.checked)))
{
base.prop_all.checked=true;
base.prop_owner.checked=false;
base.prop_builder.checked=false;
base.prop_broker.checked=false;
if(show_newprojects)
base.prop_newprojects.checked=false;
}
if(!base.prop_owner.checked && !base.prop_builder.checked && !base.prop_broker.checked && (!show_newprojects || (show_newprojects && !base.prop_newprojects.checked)))
{
base.prop_all.checked=true;
base.prop_owner.checked=false;
base.prop_builder.checked=false;
base.prop_broker.checked=false;
if(show_newprojects)
base.prop_newprojects.checked=false;
}
else
{
base.prop_all.checked=false;
}
checkNPerror();
}
}
';
$data['extra_head'] .='';
$data['extra_foot'] = $this->proto_js_form($data['reg_form']['id']);



thanks again for fast reply
Kuldeep Kamboj
#5

[eluser]wiredesignz[/eluser]
Your Controller should not be named Index.

The Controller is initialised first by running the Index() method, and then called a second time by the router because index() is the default method for a controller.

Thus duplicate output.




Theme © iAndrew 2016 - Forum software by © MyBB