Posted by Schmidty on 01/13/07 01:01
Sorry about the typo, it should be '$unknown'. Thanks for the help!! :)
Schmidty
Colin McKinnon wrote:
> Schmidty wrote:
>
> > Fairly new to OOP and PHP5.
> <snip>
> >
> > Example ==========================================================
> >
> > class NAME {
> > public $name;
> > public $unknown;
> > public $value;
> >
> >
> > function __construct($value) {
> > $this->setName($this->value);
>
> no - I guess you want to assign the value in the parameter using the setName
> method...
> $this->setName($value);
> > }
> >
> > function setName($value) {
> > $this->name = $value;
>
> Yup - just like that
>
> > }
> >
> > function getName() {
> > return $this->name;
> > }
> >
> > function nameKid($unknown) {
> > $this->setName($unkown);
> erm, not sure what this is trying to (even without the typo).
>
> Looks like your nearly there.
>
> HTH
>
> C.
Navigation:
[Reply to this message]
|