Add page to backend controller

I am developing a plugin. I wanted to create a page where the admin can mass import data through a textarea. So I took the create.php content and copied to a new file masscreate.php. I adjusted the masscreate.php file so that there is a textarea, e.g.

// ...
    <?= Form::open(['class' => 'layout']) ?>

        <div class="layout-row">
            <textarea id="urls"></textarea>
        </div>

// ...

I also create two functions in the controller

    public function masscreate()
    {
    }

    public function masscreate_onSave()
    {
    }

When I now open the page http://.../masscreate, I get the error message

Undefined variable $formRecordName

Any idea how to solve this error message?

Hey @kstarkloff

You may need to call the initForm method to make this variable available. It also depends on the model object, you can create an empty model to set up the $model variable;

$model = new MyModel;
$this->initForm($model);