Skip to content

Instantly share code, notes, and snippets.

@Nikschavan
Created September 19, 2016 13:59
Show Gist options
  • Save Nikschavan/a5e580e3e0851191d5978369994a1c0b to your computer and use it in GitHub Desktop.
Save Nikschavan/a5e580e3e0851191d5978369994a1c0b to your computer and use it in GitHub Desktop.
Boilerplate for a PHP class
<?php
/**
* CLASS_NAME setup
*
* @since 1.0
*/
class CLASS_NAME {
private static $instance;
/**
* Initiator
*/
public static function instance(){
if ( ! isset( self::$instance ) ) {
self::$instance = new CLASS_NAME();
// self::$instance->includes();
// self::$instance->hooks();
}
return self::$instance;
}
}
$CLASS_NAME = CLASS_NAME::instance();
@jpesquibel
Copy link

Very Helpful. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment