PHP code example of geniv / nette-visitation

1. Go to this page and download the library: Download geniv/nette-visitation 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-visitation example snippets


use Visitation;

protected function createComponentVisitation(Visitation $visitation)
{
    $visitation->setTemplatePath(__DIR__ . '/templates/visitation.latte');
    $visitation->getMessage()
        ->setFrom($this->context->parameters['emailSetup']['visitation']['from'])
        ->addTo($this->context->parameters['emailSetup']['visitation']['to'])
        ->setSubject('Sjednání prohlídky');

    if (isset($this->context->parameters['emailSetup']['visitation']['bcc'])){
        $visitation->getMessage()->->addBcc($this->context->parameters['emailSetup']['visitation']['bcc']);
    }

    $visitation->onSuccess[] = function ($values) {
        $this->flashMessage($this->translator->translate('visitation-onsuccess'), 'info');
        $this->redirect('this');
    };
    return $visitation;
}
json
"php": ">=5.6.0",
"nette/nette": ">=2.4.0",
"dibi/dibi": ">=3.0.0",
"geniv/nette-locale": ">=1.0.0"