|
Comments for: kris_hadlock20080215
| Message # 1510467: |
|
Date: 02/16/08 06:06
By: Daniel Subject: function __construct() Using PHP5 is great if you use OOP in the right way. So it's better to create a __contruct function to replace public function Product() {} like this: function __construct($name, $price, $photo, $description) { $this->name = $name; $this->price = $price; $this->photo = $photo; $this->description = $description; } then in the child class you can use parent:: to take parent __construct and extend it: function __construct($name, $price, $photo, $description, $model) { parent::__construct($name, $price, $photo, $description); $this->model = $model; } Cheers Daniel |
Previous Message | Next Message |
| Comments: | ||
| function __construct() | Daniel | 02/16/08 06:06 |
|
If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly. | ||


