I've a class - validate_class.
A Constructor inside.
check_username function that contains couple other methods that validate username. I want to call these three methods that are inside check_username method when it's called.
Code:
function check_username(){
//Checks if is username empty
function validate_empty_username(){
if($this->empty_username){
echo "<li>Please fill username field</li>";
return false;
}
}
//Check username length is short
function validate_username_length_min(){
if(($this->get_username_length < 3) and ($this->empty_username !== true) ){
echo "<li>Username provided's too short!</li>";
return false;
}
}
//Check username length is long
function validate_username_length_max(){
if($this->get_username_length > 15){
echo "<li>Username's too long</li>";
return false;
}
}
}