for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace diecoding\toastr;
use yii\helpers\Json;
/**
* Toastr widget
*
* @link [sugeng-sulistiyawan.github.io](sugeng-sulistiyawan.github.io)
* @author Sugeng Sulistiyawan <[email protected]>
* @copyright Copyright (c) 2023
*/
class Toastr extends ToastrBase
{
* @var string
public $type;
public $title;
public $message;
* @inheritdoc
public function run()
$type = $this->type && in_array($this->type, self::TYPES) ? $this->type : $this->typeDefault;
$title = $this->title ?: $this->titleDefault;
$message = $this->message ?: $this->messageDefault;
$options = Json::encode($this->options);
$this->view->registerJs("toastr.{$type}(\"{$message}\", \"{$title}\", {$options});");
}