{ Snipperize } /handler

Snippets about handler

Here are the latest snippets talking about handler. Please choose your favorite one or add a new one.

Global Error Handler

I found a very interesting method to handle errors on JavaScript. What this does is to handle all error occurs in the script to a single function so whenever any error occurs, it will go into this particular function and alert the user. What it does is that whenever a run time error occurs, the function will goes into action! For example you try to trigger a function that does not exist! Instead of making your program stop functioning, we can provide a error message using the above method which can promote a more user friendly environment whenever an error occurs on our script. This is neat stuff!

Javascript / global, error, handler, alert, onerror / by ThePeppersStudio (372 days, 6.78 hours ago)

Super File System Service

The one and only class for all your file handling needs. Browse a directory and all child directories: $filesSvc = new FileSystemService ( ); $templates = $filesSvc->browseDirectory ( '../path/to/directory', true ); echo jsonencode ( $templates ); printr( $templates ); Read a file: $file = FileSystemService::readFile ( '/path/to/file.html' ); echo ( $file ); Write a file: $file = FileSystemService::writeFile ( 'FileName', 'Is this enough information Vordreller? I think you should try to experiment.' );

PHP / file, directory, handler / by ThePeppersStudio (382 days, 14.10 hours ago)

  • 1