Welcome Guest, Not a member yet? Register   Sign In
[Solved] Return $data question
#6

(This post was last modified: 02-15-2016, 03:27 AM by Avenirer.)

if you defined the $message depending on the if statement, then you should also return the $message from inside the if statement...

Code:
public function display_error_messages($open_tag = '<p>', $close_tag = '</p>') {

        if (isset($this->error_message)) {

            $message = "";

            foreach($this->error_message as $msg) {
                $message .= $open_tag . $msg . $close_tag;
            }
            return $message;


        }
        return FALSE; // or whatever you want to return in case there are no error messages...

        

    } 
But it is you who should tell me if it's correct or not Smile
Reply


Messages In This Thread
[Solved] Return $data question - by wolfgang1983 - 02-15-2016, 02:35 AM
RE: Return $data question - by Diederik - 02-15-2016, 02:51 AM
RE: Return $data question - by wolfgang1983 - 02-15-2016, 02:57 AM
RE: Return $data question - by Avenirer - 02-15-2016, 03:02 AM
RE: Return $data question - by wolfgang1983 - 02-15-2016, 03:06 AM
RE: Return $data question - by Avenirer - 02-15-2016, 03:27 AM
RE: Return $data question - by wolfgang1983 - 02-15-2016, 03:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB