Welcome Guest, Not a member yet? Register   Sign In
Problem using a tempate
#1

[eluser]Diegosf93[/eluser]
Hi i have this problem when i want to use a template page look:

template.php

Code:
<?php $this->load->view('header'); ?>

<?php echo $contenido ?>


<?php $this->load->view('footer'); ?>

But when in a controller i want to load a view like this:

Code:
public function Agregar_Programa()
  {
   $data['contenido']=$this->load->view('Panel_Operador/Panel_Operador',true);
   $this->load->view('template',$data);

  }

Its show like this:
asas This is the text that i have in the Panel_operador view.
<html>
<head>
<title>Holaa</title>


<link type="text/css" rel="stylesheet" href="http://localhost/CodeIgniter_2.1.2/css/jquery-ui-1.8.21.custom.css">
[removed][removed]
[removed][removed]

And this other is what i have at the header.php

Why its loading the view content before the html. ?

Thanks
#2

[eluser]Diegosf93[/eluser]
Nobody?=
#3

[eluser]Aken[/eluser]
The "return a loaded view as a string" parameter is the third one, not second. Should be:

Code:
$this->load->view('Panel_Operador/Panel_Operador', null, true)




Theme © iAndrew 2016 - Forum software by © MyBB