I'd like to create a simple plugin with a form on the front end which submits the value of 3 fields into a DB table.
For the plugin, I've been using this answer: https://wordpress.stackexchange.com/a/162476/77891
What I can't get working now, is a template.
Within the main plugin file, I've added:
add_action( 'gm_virtual_pages', function( $controller ) {
// first page
$controller->addPage( new \WEBP\Management\Page( '/custom/page' ) )
->setTitle( 'My First Custom Page' )
->setTemplate( 'custom-page-form.php' );
} );
And my custom-page-form.php
:
<?php
echo "Test Echo";
?>
<p>Test</p>
<p>Echo</p>
The title is being displayed (My First Custom Page). But not my Test Echo. How does a correct / working template file have to look like?