Posted By

wbowers on 02/28/08


Tagged

class php object textmate oop Generic skeleton


Versions (?)

Who likes this?

22 people have marked this snippet as a favorite

Wiederkehr
Abe
TimFletcher
sonix
jamarama
pixelhandler
cbrant
floweb
bryandease
loric
huynguye
Juntalis
vehler
dinkan
ninjacharlee
mmcachran
mecha
lfcortes
prit
scottshane
pelted
ringo380


Generic PHP Class


 / Published in: PHP
 

  1. <?php
  2.  
  3. require_once('SuperClass.php');
  4.  
  5. /**
  6.  * This is a class
  7.  *
  8.  * @author Your Name
  9.  * @copyright Your Copyright info
  10.  */
  11. class ClassName extends SuperClass
  12. {
  13. // PUBLIC PROPERTIES --------------------------------------------------------------
  14.  
  15. /**
  16. * This is a public variable
  17. *
  18. * @author Your Name
  19. */
  20. public $publicVar = 'a public variable';
  21.  
  22. // PRIVATE PROPERTIES -------------------------------------------------------------
  23.  
  24. /**
  25. * This is a private variable
  26. *
  27. * @author Your Name
  28. */
  29. private $privateVar = array();
  30.  
  31. // MAGIC METHODS ------------------------------------------------------------------
  32.  
  33. /**
  34. * The constructor
  35. *
  36. * @author Your Name
  37. */
  38. public function __construct ()
  39. {
  40. parent::__construct();
  41. }
  42.  
  43. /**
  44. * The destructor
  45. *
  46. * @author Your Name
  47. */
  48. public function __destruct ()
  49. {
  50. parent::__destruct();
  51. }
  52.  
  53. // PUBLIC METHODS -----------------------------------------------------------------
  54.  
  55. /**
  56. * This is a public method
  57. *
  58. * @author Your Name
  59. */
  60. public function publicMethod ()
  61. {
  62. // do something
  63. }
  64.  
  65. // PRIVATE METHODS ----------------------------------------------------------------
  66.  
  67. /**
  68. * This is a private method
  69. *
  70. * @author Your Name
  71. */
  72. private function privateMethod ()
  73. {
  74. // do something
  75. }
  76. }
  77.  
  78. ?>

Report this snippet  

You need to login to post a comment.