note 83627 added to language.oop5.late-static-bindings
| From: | tylerATcanfone | Date: | Thu, 05 Jun 2008 05:48:34 +0000 |
| Subject: | note 83627 added to language.oop5.late-static-bindings | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140135@lists.php.net to get a copy of this message | ||
@ php at mikebird
You can pass arguments to your constructor through your getInstance method, assuming you are running
php5.
public static function getInstance($params = null) {
if (self::$objInstance == null) {
$strClass = static::getClass();
self::$objInstance = new $strClass($params);
}
return self::$objInstance;
}
This would pass the params to your constructor. Love for php.
----
Server IP: 66.207.199.35
Probable Submitter: 24.203.53.42
----
Manual Page -- http://www.php.net/manual/en/language.oop5.late-static-bindings.php
Edit -- https://master.php.net/note/edit/83627
Del: integrated -- https://master.php.net/note/delete/83627/integrated
Del: useless -- https://master.php.net/note/delete/83627/useless
Del: bad code -- https://master.php.net/note/delete/83627/bad+code
Del: spam -- https://master.php.net/note/delete/83627/spam
Del: non-english -- https://master.php.net/note/delete/83627/non-english
Del: in docs -- https://master.php.net/note/delete/83627/in+docs
Del: other reasons-- https://master.php.net/note/delete/83627
Reject -- https://master.php.net/note/reject/83627
Search -- https://master.php.net/manage/user-notes.php