Error loading an template view |
[eluser]Diegosf93[/eluser]
I have this problem when i try to load an template view with another view, lets see the code: This is the code of the template: Code: <?php $this->load->view('header.php'); ?> Then in the controller i have this: Quote:Here I load a droplist with categories and i pass it to the "Agregar_Operador" view in a variable. Code: $datas['categorias']=$this->Admin_Model->Cargar_Categorias(); This appear me in the browser: http://imageshack.us/photo/my-images/402...ravlh.png/ Thanks!
[eluser]DarkManX[/eluser]
the view loader need the view name not the view filename - 'header' and 'footer'
[eluser]CroNiX[/eluser]
You've already loaded the view into the $contenido variable in your controller. Just Code: echo $contenido; Code: <?php $this->load->view($contenido); ?>
[eluser]vitoco[/eluser]
When you load a view, the first parameter it's the filename of the view Code: <?php $this->load->view('header.php'); ?> But here Code: $data['contenido']=$this->load->view('Panel_Admin/Agregar_Operador', $datas,true); you're storing in ['contenido'] the returned html from the view 'Panel_Admin/Agregar_Operador', not the view filename. so change it to this. Code: <?php $this->load->view('header.php'); ?> Slds
[eluser]Diegosf93[/eluser]
Thanks very much for the answers, I solved the problem! I edit this: I have this other problem i have in another controller this code: Code: function index() I need to save the view "formulario_login" in a variable to pass it to the template view like i do before? |
Welcome Guest, Not a member yet? Register Sign In |