Welcome Guest, Not a member yet? Register   Sign In
How to use attributes in controller or model?
#1

[eluser]djuric[/eluser]
I have function in Model like this:

Code:
public function cats($post_id = null) {  

  $qveri = $this->db->query("SELECT * FROM posts WHERE id = $post_id");
  return $qveri->result_row();
}

This is in controller:

Code:
$data['cats'] = $this->clean_blue_model->cats($post_id);


My question would be CAN I pass attributes to functions inside controller, like I did above, I'm getting error like variable $post_id not defined

What's the right way to pass variable to function like this?



Messages In This Thread
How to use attributes in controller or model? - by El Forum - 04-16-2012, 06:43 AM
How to use attributes in controller or model? - by El Forum - 04-16-2012, 07:34 AM
How to use attributes in controller or model? - by El Forum - 04-16-2012, 07:41 AM
How to use attributes in controller or model? - by El Forum - 04-16-2012, 07:44 AM
How to use attributes in controller or model? - by El Forum - 04-16-2012, 08:20 AM
How to use attributes in controller or model? - by El Forum - 04-16-2012, 10:44 AM
How to use attributes in controller or model? - by El Forum - 04-17-2012, 01:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB