フォームを作成するクラスと、ビュー ファイルからフォーム名フォーム アクションとフォーム タイプを取得する関数があります。期待どおりに正常に動作しますが、別の関数でこれらの変数を呼び出して実際のフォームを作成し、値を追加すると、空白として返されます。
class Form {
private $formname;
private $formaction;
private $formtype;
function Form($form_name, $actionfile, $formtype) {
$this->formname = $form_name;
$this->formaction = $actionfile;
$this->formtype = $formtype;
}
これは、関数の値がプライベート変数に格納される場所です。
別の関数でそれらを呼び出そうとすると、空白として返されます。
function formstart() {
$enc = 'enctype="multipart/form-data"';
$returnstring = '<form name="' . $this->formname . '" id="' . $this->formname . '" ' . $enc . ' method="' . $this->formtype . '" action="' . $this->formaction . '">';
}
何か不足していますか?