PHP code example of erikgreasy / wp-advanced-forms

1. Go to this page and download the library: Download erikgreasy/wp-advanced-forms library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

erikgreasy / wp-advanced-forms example snippets




namespace App\Forms;

use Erikgreasy\WpAdvancedForms\FormComponent;

class ContactForm extends FormComponent
{
    public bool $usesAjax = true;

    public function handleSubmit()
    {
        // This is where we handle our form.
        // We can use provided laravel validator
        $validator = $this->validator->make($_POST, [
            'name' => '

WpAdvancedForms::load([
    ContactForm::class,
]);


$form = \Erikgreasy\WpAdvancedForms\WpAdvancedForms::getForm(
    \App\Forms\ContactForm::class
);