PHP code example of tegimus / php-izitoast

1. Go to this page and download the library: Download tegimus/php-izitoast 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/ */

    

tegimus / php-izitoast example snippets


use Tegimus\IziToast\Toast;

$toast = new Toast();

$toast = Toast::make();

$title = 'Test';
$message = 'My sample message';
$type = Toast::TYPE_SUCCESS;
$options = ['progressBar' => false];

$toast = new Toast($message);
//or
$toast = Toast:make($message, $title, $type, $options);

$toast->type(Toast::TYPE_ERROR);

$toast->option('timeout', false);

$toast->mergeOptions([
  'position' => 'bottomRight',
  'timeout' => 6000,
  'pauseOnHover' => false,
]);

$toast->options([
  'message' => 'Sample message',
  'title' => 'Replace',
  'position' => 'bottomRight',
  'timeout' => 6000,
  'pauseOnHover' => false,
]);

//clear 'position' option
$toast->clear('position');
//clear all options
$toast->clear();

composer 
html
<script>
   $toast->render()