Shawn McKenzie wrote:
Shawn McKenzie wrote:
Peter van der Does wrote:
On Thu, 21 May 2009 14:08:11 -0500
Shawn McKenzie wrote:
This doesn't make sense. You say "class A needs to be extended with
another class", however what you show below is "class A extending
framework_class".
I worded
Shawn McKenzie wrote:
> Peter van der Does wrote:
>> On Thu, 21 May 2009 14:08:11 -0500
>> Shawn McKenzie wrote:
>>
>>
>>> This doesn't make sense. You say "class A needs to be extended with
>>> another class", however what you show below is "class A extending
>>> framework_class".
>>>
>> I worde
Peter van der Does wrote:
> On Thu, 21 May 2009 14:08:11 -0500
> Shawn McKenzie wrote:
>
>
>> This doesn't make sense. You say "class A needs to be extended with
>> another class", however what you show below is "class A extending
>> framework_class".
>>
>
> I worded it wrong, I apologize.
> C
On Thu, 21 May 2009 14:08:11 -0500
Shawn McKenzie wrote:
>
> This doesn't make sense. You say "class A needs to be extended with
> another class", however what you show below is "class A extending
> framework_class".
>
I worded it wrong, I apologize.
Class A needs to be an extension of the f
Peter van der Does wrote:
> I have the following situation.
>
> I wrote some software and split it up into functionality:
>
> class core {
> function go{
> }
> }
>
> class A extends core {
> // PHP4 constructor
> function A {
> $this->go();
> }
>
> }
>
> class B extends core {
>
Peter van der Does wrote:
I have the following situation.
I wrote some software and split it up into functionality:
class core {
function go{
}
}
class A extends core {
// PHP4 constructor
function A {
$this->go();
}
}
class B extends core {
}
In core I define functions and va
I have the following situation.
I wrote some software and split it up into functionality:
class core {
function go{
}
}
class A extends core {
// PHP4 constructor
function A {
$this->go();
}
}
class B extends core {
}
In core I define functions and variables that are to be used
What does "$this->A(); "" do ?(in constructor of class B)
does it make another instance of class A, and if not why do I have to
parse vars to the A constructor ($this->A($var1,$var2))?.
I dont think that is what I want.
A can have many instances of B. B can have many instances of C.
Well in this example it will get to an infinite loop, but anyway like
Thomas said you must check into extending classes.
Andy
Thomas Munz wrote:
> Use 'extends' syntax for sub classes
>
> class A {
> var $some_var;
>var $class_B;
> function A(){
>
Use 'extends' syntax for sub classes
class A {
var $some_var;
var $class_B;
function A(){
$this->class_B = new B();
$this->some_var=2;
}
}
class B extends A {
var $class_C;
function B(){
$
I have 3 classes, CLASS A,B and C
class A {
var $some_var;
var $class_B;
function A(){
$this->class_B = new B();
$this->some_var=2;
}
}
class B {
var $some_var;
var $class_C;
function B(){
Hi,
Thursday, August 15, 2002, 5:17:00 AM, you wrote:
MA> Well, I actually have a full db class which has a connect and close method
MA> as well as query, fetch_array, etc... What I really want to know is how to
MA> use the methods in my db class from another class (myclass for example)..
MA> D
Do you know where I can find more info on how to use the scope resolution
operator?
My searches aren't giving much (at leant not mcuh regarding php) and in the
manual, it only shows up momentarily as a note in the operators section...
Mark
"Nick Oostveen" <[EMAIL PROTECTED]> wrote in message
That seems more like what I'm looking for..
Thank you, Nick...
Mark
"Nick Oostveen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> If you are just trying to access a classes functions without creating an
> instance of it you're probably looking to use the
e:
> $this->mydb(); This way you can always reuse the method from other code.
>
> hth,
> Steve.
>
> -Original Message-
> From: Mark Armendariz [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 14, 2002 2:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP]
If you are just trying to access a classes functions without creating an
instance of it you're probably looking to use the scope resolution operator
::. For this to work all you have to do is ensure that the definition for
the class you wish to use is included into the file containing the clas
AIL PROTECTED]]
Sent: Wednesday, August 14, 2002 2:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP - class question
Hello, To begin.. i'm new to the list...
I'm trying to learn good practices in OOP based PHP. I'm actually a bit new
to OOP in general, but I've done quite a bit
Hello, To begin.. i'm new to the list...
I'm trying to learn good practices in OOP based PHP. I'm actually a bit new
to OOP in general, but I've done quite a bit of reading and playing around
with it in the past couple of months.
What I'm trying to figure out is the proper way to call a class
EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 1:17 PM
To: Php-General-List (E-mail)
Subject: [PHP] class question 2
Sorry Another question-
Do instances of classes remain in 'communication' with each other if
declared my different functions in a case switch statement.
At present I have
] class question 2
Sorry Another question-
Do instances of classes remain in 'communication' with each other if
declared my different functions in a case switch statement.
At present I have an admin.php which is one long swtich statement.
Wihin each is a list iof functions which c
Sorry Another question-
Do instances of classes remain in 'communication' with each other if
declared my different functions in a case switch statement.
At present I have an admin.php which is one long swtich statement.
Wihin each is a list iof functions which created the elements of the page
Well, I guess many things are "accepted" now, but here's my two cents:
I wouldn't access global variables, instead you should pass everything you
need as parameters. Using global variables can come back to bite you
occasionally because you may think you are changing a local variable at one
po
again you want to use objects.
As for practice, it is up to you. For me, no...
Ray Hunter
Firmware Engineer
ENTERASYS NETWORKS
-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 1:58 PM
To: PHP General
Subject: [PHP] Class question
I'm still kind of new when it comes to dealing with classes.
I'm curious, is it accepted practice for member functions of
your class to:
* access global variables
* use non member, user defined functions
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www
Hello,
This is the first time I write OOP in PHP. I wrote a small class for
Mysql and from the index.php, I am calling the new function. I have a
display before new class and I have a display after the new and only the
display I am getting is the before class and after that there is no error.
25 matches
Mail list logo