[eluser]d4v0[/eluser]
Hi everybody!
I've been trying to work with with the MVC using CI, but i have some problems! :red:
I'm just a beginner! ... But I want to learn more than CI!
Well, this is my model: 'mimodelo.php'
Code:
<?PHP
class Mimodelo extends Model
{
function Mimodelo()
{
parent::Model();
}
function obtenertodo()
{
$datos = array();
$consulta = $this->db->get("ALL_M_RUB");
$datos = $consulta->row_array();
return $datos;
}
}
?>
As you see, my table's name is ALL_M_RUB.
This is my controller: 'micontrol.php' :cheese:
Code:
<?PHP
class Micontrol extends Controller
{
function Micontrol()
{
parent::Controller();
$this->load->database();
}
function index()
{
$this->load->model('Mimodelo','',TRUE);
$data['contenido'] = $this->Mimodelo->obtenertodo();
$this->load->view('mivista',$data);
}
}
?>
And finally, this is my view ... but it's incomplete... 'mivista.php' :roll:
Code:
<?PHP
foreach($contenido as $elemento)
{
//here goes my results
}
?>
That's my poblem..! :-S ... I don't know how to catch the results and show them all!
The fields of my table are 3: 'RUB_ORD' , 'RUB_DES' and 'RUB_STATUS'.
What is missing... or what am i doing bad??
Help! ... =(
Thanks!