Skip to content

Instantly share code, notes, and snippets.

@dexit
Forked from Nikschavan/class-boilerplate.php
Created October 24, 2018 07:50
Show Gist options
  • Save dexit/0829b3d9397709f2a327ed6c9a14903c to your computer and use it in GitHub Desktop.
Save dexit/0829b3d9397709f2a327ed6c9a14903c 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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment