note 109878 added to language.oop5.traits
| From: | Bandi | Date: | Thu, 30 Aug 2012 13:00:42 +0000 |
| Subject: | note 109878 added to language.oop5.traits | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-190273@lists.php.net to get a copy of this message | ||
My problem is I can't access the traits constructor from the class constructor:
<?php
trait bar
{
public function __construct($bar) {
echo $bar;
}
}
class foo
{
use bar;
public function __construct($foo) {
//here i want to call constructor of bar trait, but how?
//parent::__construct('dasdas') ???????
//bar::__construct('dasdas') ???????
echo $foo;
}
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 178.164.185.158
----
Manual Page -- http://www.php.net/manual/en/language.oop5.traits.php
Edit -- https://master.php.net/note/edit/109878
Del: integrated -- https://master.php.net/note/delete/109878/integrated
Del: useless -- https://master.php.net/note/delete/109878/useless
Del: bad code -- https://master.php.net/note/delete/109878/bad+code
Del: spam -- https://master.php.net/note/delete/109878/spam
Del: non-english -- https://master.php.net/note/delete/109878/non-english
Del: in docs -- https://master.php.net/note/delete/109878/in+docs
Del: other reasons-- https://master.php.net/note/delete/109878
Reject -- https://master.php.net/note/reject/109878
Search -- https://master.php.net/manage/user-notes.php