![]() |
![]() |
![]() | |
![]() International Sites:
|
Defining Instances or Deriving ClassesGenerally there are two possibilities to use a class:
Either you generate an instance of this class or you derive a further class from it. myArticle = new PContentArticle ("Contact");
The article myArticle is initialised automatically by the constructor. You find more specific information in the description of the class PContentArticle. The constructor of PContentArticle also calls the constructor of the ancestor PContent which again calls the constructor of its ancestor PObject. Since PObject is the root object, the initialisation sequence ends at this object. class PNewArticle extends PContentArticle { } Now you have defined a new object but it doesn’t differ in any way from its derivation object PContentArticle. Therefore you have to define new functions in your new class or to overwrite existing functions. You can - for instance - implement your own initialisations with a new constructor. For further reference on instances and derivations please consult the website of the language PHP, or several portals and websites which deal with PHP more or less elaborately or the previous elaborate introductory tutorial to object-oriented programming in PHP in this documentation. [Back] - [Bookmark] - [Optimized for Printing] - [Send by E-mail] - [Contact] Copyright © 2000-2002 by Portunity GmbH (Germany) - All rights reserved. |
![]() ![]()
Direct links to the new Portalsuite 2002: |