PHP code example of geniv / nette-identity-registration

1. Go to this page and download the library: Download geniv/nette-identity-registration 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/ */

    

geniv / nette-identity-registration example snippets


protected function createComponentIdentityRegistration(RegistrationForm $registrationForm): RegistrationForm
{
    //$registrationForm->setTemplatePath(__DIR__ . '/templates/RegistrationForm.latte');
    $registrationForm->onSuccess[] = function (array $values) {
        $this->flashMessage('Registration!', 'info');
        $this->redirect('this');
    };
    $registrationForm->onException[] = function (RegistrationException $e) {
        $this->flashMessage('Registration exception! ' . $e->getMessage(), 'danger');
        $this->redirect('this');
    };
    return $registrationForm;
}

public function actionApprove($h)
{
    try {
        if ($this->identityModel->processApprove($h)) {
            $this->flashMessage('Approve!', 'info');
        }
    } catch (IdentityException $e) {
        $this->flashMessage('Approve exception! ' . $e->getMessage(), 'danger');
    }
    $this->redirect('default');
}
json
"php": ">=7.0.0",
"nette/nette": ">=2.4.0",
"geniv/nette-general-form": ">=1.0.0"