PHP code example of nowo-tech / slide-to-confirm-bundle

1. Go to this page and download the library: Download nowo-tech/slide-to-confirm-bundle 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/ */

    

nowo-tech / slide-to-confirm-bundle example snippets




return [
  // ...
  Nowo\SlideToConfirmBundle\NowoSlideToConfirmBundle::class => ['all' => true],
];

use Nowo\SlideToConfirmBundle\Form\Type\SlideToConfirmType;
use Symfony\Component\Form\Extension\Core\Type\MoneyType;

$builder
    ->add('amount', MoneyType::class, ['currency' => 'EUR'])
    ->add('confirm', SlideToConfirmType::class, [
        'profile' => 'payment',
    ]);

use Nowo\SlideToConfirmBundle\Form\Type\SlideToConfirmType;
use Nowo\SlideToConfirmBundle\Form\Type\SwipeToSubmitType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;

// Destructive
$builder->add('confirm', SlideToConfirmType::class, ['profile' => 'danger']);

// Batch submit (this field *is* the submit)
$builder->add('confirm', SwipeToSubmitType::class, [
    'profile' => 'payment',
    'text'    => sprintf('Slide to approve %d payments', $count),
]);

// Gate: unlock a regular button
$builder
    ->add('unlock', SlideToConfirmType::class, ['profile' => 'gate'])
    ->add('save', SubmitType::class);