Skip to content

Instantly share code, notes, and snippets.

@rowatt
Last active January 4, 2016 22:19
Show Gist options
  • Save rowatt/8687139 to your computer and use it in GitHub Desktop.
Save rowatt/8687139 to your computer and use it in GitHub Desktop.
Singleton Class Template
<?php
SINGLETON::get_instance();
class SINGLETON extends Presi_Core_Class
{
private static $instance = NULL;
public static function get_instance()
{
NULL === self::$instance and self::$instance = new self;
return self::$instance;
}
private function __construct()
{
//construct here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment