Skip to content

Commit

Permalink
adding helper debug php
Browse files Browse the repository at this point in the history
  • Loading branch information
Risyandi committed May 6, 2019
1 parent 933f1b6 commit a0beb87
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions source-apps/helpers/help-debug.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class PHPdebug {
function debug($name, $var = null, $type = LOG) {
echo '<script type="text/javascript">'.NL;
switch($type) {
case LOG:
echo 'console.log("'.$name.'");'.NL;
break;
case INFO:
echo 'console.info("'.$name.'");'.NL;
break;
case WARN:
echo 'console.warn("'.$name.'");'.NL;
break;
case ERROR:
echo 'console.error("'.$name.'");'.NL;
break;
}
}

0 comments on commit a0beb87

Please sign in to comment.