Issues (4)

example/example.php (1 issue)

1
<?php
2
require __DIR__ . "/../vendor/autoload.php";
3
4
$trigger = new \ElePHPant\Trigger\Trigger();
5
6
$trigger->success("Hello World!", "Great!");
7
8
$trigger->error("Something's wrong!", "Bad");
9
10
11
var_dump($trigger);
12
13
//Unique Error
14
var_dump($trigger->render());//Debug a only one Object with the Success Message;
15
16
//Several Error
17
var_dump($trigger->render(false));//Debug all errors (success and error);
18
19
### METHODS
20
$trigger->success("Body Message", "Title Message", ["field"], 4000);
21
$trigger->error("Body Message", "Title Message", ["field"], 4000);
22
$trigger->warning("Body Message", "Title Message", ["field"], 4000);
23
$trigger->info("Body Message", "Title Message", ["field"], 4000);
24
25
$trigger->fields();// Show all fields
26
$trigger->render() || $trigger->render(false);//Render the Message(s)
27
$trigger->messages();//Show Messages
28
$trigger->titles();//Show Titles
29
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...