제목에 내 방법 중 하나에 많은 조건문이 있습니다. 그 중 내 두 가지에 붙어 있습니다 return FALSE
내 조건 중 두 가지.메서드는 FALSE를 여러 번 반환합니다.
내 컨트롤러에서 나는 메소드가 true를 반환하는 경우 확인 그래서 내가 MVC를 사용하고 있습니다 :
if ($this -> m_homepage -> reset_pw($step = 1, $value)) { // If all is true in method redirect
$this -> session -> set_flashdata('message', 'A Message Was Sent');
redirect('c_homepage/index', 'location');
} elseif ($this -> m_homepage -> reset_pw($step = 1, $value) == 'badcap') { // If captcha fails return bad_recaptcha
var_dump("bad_recaptcha");
} else { // if any other FALSE happens (only one more left) then that means account is locked
var_dump("account is locked");
}
내 방법
: 내 방법 통지에 따라서if (!$cap -> is_valid) {// If reCaptcha not valid
return 'badcap';
} else {// If reCaptcha is valid
if ($lockedaccount == '1') {// If account is locked (1)
return FALSE; // No email should be sent period.
} else {
if ($no_employee) {// email does not exist then
................ // Set up email body and what not
if ($email_sent() { // If email is sent
$this -> session -> unset_userdata('email');
return TRUE;
}
}
}
}
나는 거짓 진술을 얼마나 , 그리고 문자열을 반환하는 명령문. 내 컨트롤러에서 어느 것이 반환되는지 구별하는 방법은 무엇입니까?
if ($this -> m_homepage -> reset_pw($step = 1, $value) == 'badcap') {
// This will allow me to execute code is the recaptcha (badcap) is returned
}
여기 내 논리가 올바르지 않습니다
이 같은 일을 생각했다? 어떤 도움이라도 좋을 것입니다.
편집 한
var_dump($this -> m_homepage -> reset_pw($step = 1, $value));
는
질문에 대한 오해가있을 수 있습니다 .. !! 알려주세요 .. !! –