message() 공개 메소드

By default the alert is not typed.
public message ( string $text, string $title = '', string $type = null ) : SweetAlertNotifier
$text string
$title string
$type string
리턴 SweetAlertNotifier $this
예제 #1
0
 /** @test */
 public function it_will_add_the_html_option_to_config_when_using_an_html_alert()
 {
     $session = m::mock(SessionStore::class);
     $session->shouldReceive('flash')->atLeast(1);
     $notifier = new SweetAlertNotifier($session);
     $expectedConfig = ['timer' => 1800, 'title' => 'Alert', 'text' => '<strong>This should be bold!</strong>', 'showConfirmButton' => false, 'html' => true];
     $expectedJsonConfig = json_encode($expectedConfig);
     $notifier->message('<strong>This should be bold!</strong>', 'Alert')->html();
     $this->assertEquals($expectedConfig, $notifier->getConfig());
     $this->assertEquals($expectedJsonConfig, $notifier->getJsonConfig());
 }
예제 #2
0
 /**
  * Display an alert message with a text and an optional title.
  * 
  * By default the alert is not typed.
  *
  * @param string $text
  * @param string $type
  * @param string $title
  * @return \UxWeb\SweetAlert\SweetAlertNotifier $this
  * @static 
  */
 public static function message($text, $title = '', $type = null)
 {
     return \UxWeb\SweetAlert\SweetAlertNotifier::message($text, $title, $type);
 }