I have a class to create forms and a function that gets the form name form action and form type from the view files. It works fine and as expected, but when I call those variables in another function to create the actual form and to add the values to the they return as blank.
class Form {
private $formname;
private $formaction;
private $formtype;
function Form($form_name, $actionfile, $formtype) {
$this->formname = $form_name;
$this->formaction = $actionfile;
$this->formtype = $formtype;
}
This is where the functions values get stored in the private variables.
When I try to call them in another function they return as blank.
function formstart() {
$enc = 'enctype="multipart/form-data"';
$returnstring = '<form name="' . $this->formname . '" id="' . $this->formname . '" ' . $enc . ' method="' . $this->formtype . '" action="' . $this->formaction . '">';
}
Am I missing something ?