Level 104
What is $this->controller->insert() supposed to represent?
Can you properly format your code snippets so that they are legible?
I'm trying to pass a variable from my controller to my view file. However, I get this error. Here's a sample from my Controller file
if(empty($_REQUEST['SSN'])){
$SSN_error= 'Please fill in the Social Security Number';
// echo $form;
die();
}
else{
$SSN = $_REQUEST['SSN'];
if(!preg_match("/^[0-9]{9}$/", $SSN)) {
$SSN_error= 'Invalid SSN format';
// echo $form;
die();
}
}
and i'm trying to use the variable SSN_error (in a form) in my view file
<div class="form-group col-md-6 col-sm-6">
<label for="name"> National ID </label>
<input type="text" class="form-control input-sm" id="form-ssn" required="" name="SSN" placeholder=""></br>
<p>'.$this->controller->insert()->SSN_error.'</p>
</div>
Please or to participate in this conversation.