Get the form fields to content folder from on the front end

Or you could create a subpage to registers for each submission.
Have a form in a front-end template registers.php and use a page controller to save the submitted data.

You can get your form data within the controller with:

get('fieldname');

And to create/update a page you can do something similar to this:

try {
          page('registers/'.get('name'))->update(array(
              'title'    => get('name'),
              'degree'   => get('degree'),
              'email'    => get('email')
          ));
          $error = false;

        } catch(Exception $e) {
            $error = true;
            echo 'The user could not be updated';
            echo $e->getMessage();
        }

Not that you should not actually create/update the subpage with the direct from field data, but first have some validation on it. It’s just like this in there to simplify the example.

The benefits of this way are that you can easily add a blueprint to access that data conveniently through the panel.

2 Likes