Welcome Guest, Not a member yet? Register   Sign In
variable from model to controller
#1

[eluser]Unknown[/eluser]
I am trying to pass a image file name from a model to a controller in order to add a record to my database (id,first_name,last_name,email). The image is not in a database. I upload the image but I can’t pass the variable from the model to the controller. When I turn the variable $file into a constant ($file=‘some_image’) it does work.

Thank you.
#2

[eluser]jvicab[/eluser]
you can pass values from a model function to a calling controller by returning it. If you have more than one value to be returned, you have two choices: or create a multiarray and returning it (like return $myarrayWink or using parameters passed by refrerence to model function.
Try not to use variable names that could be actually in used by codeigniter or php!




Theme © iAndrew 2016 - Forum software by © MyBB