PHP code example of callmarl / form-manager

1. Go to this page and download the library: Download callmarl/form-manager 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/ */

    

callmarl / form-manager example snippets




namespace App;

use Form_Manager\Gabarit;

class My_Gabarit extends Gabarit
{
	public function __construct()
	{
		parent::__construct("My_Gabarit");
	}

	public function load()
	{
		// Ici la structure de notre formulaire.
	}
}

public function load()
{
	$this->add_text("Nom"); // Je créer un champs text.
	$this->nom; // J'accède à mon champs de type text appelé nom.

	$this->add_password("mot de passe"); // Je créer un champs password.
	$this->{mot de passe}; // J'accède à mon champs de type password appelé mot de passe.
}

<html>
	<head>
		<title>Form Manager Exemple</exemple>
	</head>
	<body>
		
			); // J'initialise mon formulaire.
		

public function controller_check_form()
{
	$form = new My_Gabarit(); // Nouvelle instance de mon gabarit.
	$form->load(); // Chargement de mon gabarit
	if (isset($_POST))
		$form->is_valid($_POST); // Vérification du formulaire, si une erreur existe sauvegarde de l'erreur.
	return ($form);
}

<html>
	<head>
		<title>Form Manager Exemple</exemple>
	</head>
	<body>
		
			); // J'initialise mon formulaire.
		

class My_Gabarit extends Gabarit
{
	public function __construct()
	{
		parent::__construct("My_Gabarit");
	}

	public function load()
	{
		$this->set_action("/");
		$this->set_post();
		$this->add_text("pseudo");
		$this->add_password("password");
		$this->add_submit("valider");
	}
}

public function load()
{
	$this->add_text("pseudo");
	$this->pseudo->add_control("

public function load()
{
	$this->add_date("debut");
}

public function load()
{
	$this->add_option("1");
}

public function load()
{
	$this->add_password("mot de passe");
}

public function load()
{
	$this->add_select("selection");
}

public function load()
{
	$this->add_submit("valider");
}

public function load()
{
	$this->add_text("text");
}

public function load()
{
	$this->add_select("blanck", "unknow");
}