Welcome Guest, Not a member yet? Register   Sign In
Load a function from a library for all functions into a controller
#1

[eluser]GonzaFY[/eluser]
I am sorry if you can't understand me, my english isn't the best...

Ok, I am trying to load a data for all my pages (into a controller)..
My code is this:
Code:
<?php
class Login extends CI_Controller {

function __construct(){
  parent::__construct();
$data = $this->miembros->Datos();
  
}

function index()
{
  
  $this->load->view('form', $data);
  
}

}

But it gives an error: undefined variable data...
If I put '$data = $this->miembros->Datos();' into function index() it works very well but I need load this data for all pages and I don't want put it on each function..

Thanks guys ^^!


Messages In This Thread
Load a function from a library for all functions into a controller - by El Forum - 02-10-2013, 09:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB