Ask a Question related to PHP Development, Design and Development.
-
Zurab Davitiani #1
Re: base class member access (?)
Quesote wrote:
Create $myArray as protected, not private.> class Base {
> private $myArray;
> public function Base() {
> $this->myArray = array('12', '33', '55', '99');
> }
> }
>
> class InheritedClass extends Base {
> public function createNew() {
> $this->myArray[] = 'nuevo';
> }
> }
>
>
> $a = new InheritedClass();
> $a->createNew();
>
> var_dump($a);
Zurab Davitiani Guest
-
Combining attributes with base class
Hi I am creating a custom button control, inheriting from System.Web.UI.WebControls.Button. I need to add client-side script to the onclick... -
How to learn the base class: RequiredFieldValidator?
Folks, I am trying to extend the RequiredFieldValidator control. What I am trying to accomplish should be mindlessly simple: if the... -
Base usercontrol class and wrapping
I have created a base class that inherits UserControl. The purpose of this class is to implement common functionality for all of my usercontrols... -
Access DataGrid declared in derived class from base class??
Hi! I have a base class called ListBase.vb, from which I derive EmplList.ascx.vb. In EmplList.ascx.vb I declared a... -
Session and Querystring on base class
All my .aspx.vb files inherit a base class. The base class inherits from System.Web.UI.Page So, I am trying to use Session and Querystring in the... -
Quesote #2
base class member access (?)
How can I access the Base class member inside an inherited class?
trying with this code:
class Base {
private $myArray;
public function Base() {
$this->myArray = array('12', '33', '55', '99');
}
}
class InheritedClass extends Base {
public function createNew() {
$this->myArray[] = 'nuevo';
}
}
$a = new InheritedClass();
$a->createNew();
var_dump($a);
thanks,
Quesote at Chile
Quesote Guest



Reply With Quote

