0
I have this class and function
class Controller {
public function vazio($verfica) {
if (empty($verfica)) {
return 'Vazio';
} else {
return 'Ok';
}
}
}
I call that function within the append
it is necessary to concatenate the variable within the function
divposts.append("<?php echo $ctlr->vazio("+val.valor+")?>");
There is no way to do this because PHP is processed on the server and JS in the browser after PHP has done its part.
– Sam