CodeIgniter Forums
Catching value from Model - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10)
+--- Thread: Catching value from Model (/showthread.php?tid=62349)



Catching value from Model - Jhonatan Grajales - 07-04-2015

Here is the thing, I have a model called cliente and has a field name puntos. I create a instance of that model on the controller using $data['cliente']=$this->new_cliente->get_cliente('1128434875'); and It works fine

I need to catch the field puntos from $data['cliente'] in the controller in order to compare it with other field.

I know I can get that value on a view, but I need to do it in the same controller where I created it.

HELP


RE: Catching value from Model - kenjis - 07-04-2015

How about this?

Code:
$data['cliente']->puntos



RE: Catching value from Model - skoshkarev - 07-09-2015

I usually use the following structure:


PHP Code:
if (is_array($client $this -> model -> get_client($client_id)))
{
   $client['field_name] // do something with value