Welcome Guest, Not a member yet? Register   Sign In
Call a function from within a view
#11

[eluser]CARP[/eluser]
[quote author="Demedes" date="1262444490"]Colin, I definitely agree with you!

You can use all CI functionality in your views, models and controller through $this.[/quote]

Sorry for intromission... but...
How do you call a controller function from within a view?
I've put the following line in a view:
Code:
$this->rubro->listar();
where rubro controller and listar function already exists

I'm getting this

Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$rubro
Filename: views/proveedor_asignar_rubros.php
Line Number: 140
Fatal error: Call to a member function listar() on a non-object in D:\xampp\htdocs\compras\system\application\views\proveedor_asignar_rubros.php on line 140

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB