note 95820 added to language.oop5.basic
| From: | Anonymous at osu1 dot php dot net | Date: | Sat, 23 Jan 2010 18:14:33 +0000 |
| Subject: | note 95820 added to language.oop5.basic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165237@lists.php.net to get a copy of this message | ||
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...
----
Server IP: 69.147.83.197
Probable Submitter: 24.203.203.76
----
Manual Page -- http://www.php.net/manual/en/language.oop5.basic.php
Edit -- https://master.php.net/note/edit/95820
Del: integrated -- https://master.php.net/note/delete/95820/integrated
Del: useless -- https://master.php.net/note/delete/95820/useless
Del: bad code -- https://master.php.net/note/delete/95820/bad+code
Del: spam -- https://master.php.net/note/delete/95820/spam
Del: non-english -- https://master.php.net/note/delete/95820/non-english
Del: in docs -- https://master.php.net/note/delete/95820/in+docs
Del: other reasons-- https://master.php.net/note/delete/95820
Reject -- https://master.php.net/note/reject/95820
Search -- https://master.php.net/manage/user-notes.php