Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

commented Jul 17, 2018

Very Helpful. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.