Posted By

allnatural on 01/08/10


Tagged

class object template oop oriented


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

jlan
netzwerktourist


Class Template


 / Published in: PHP
 

URL: http://www.destroyyourcomputer.com

Basic empty template for a PHP Class

  1. <?php
  2. class person {
  3. protected function set_name($new_name) {
  4. $this->name = strtoupper($new_name);
  5. }
  6. }
  7.  
  8. class employee extends person {
  9. protected function set_name($new_name) {
  10. $this->name = $new_name;
  11. }
  12. }
  13. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: alexy on February 17, 2010

Nice, been looking for this, since I'm new to php classes :D

You need to login to post a comment.