note 95820 deleted from language.oop5.basic by danbrown
| From: | danbrown@php.net | Date: | Sun, 24 Jan 2010 00:23:27 +0000 |
| Subject: | note 95820 deleted from language.oop5.basic by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165244@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
Now what if you want a class that has a construct depending on an input. Let me explain what I mean
here:
Say I have a class WebPage. Now I want to instantiate it according to a variable "lang"
passed through browsing.
so I'd have something like:
$page = new WebPage($lang);
which you can do in pure OOP, but I am wondering if it is doable in PHP as no one seem to mention
it... What would be require is a class constructor which I haven't found any reference to yet
without it being a subclass in my case the WebPage class is my point of origin and only has
dependencies on other classes...