Creating a child class is pretty simple.Just create a class and use the keyword "extend" to extend the parent class.You need to make sure that thw class that you are extending is not a FINAL class because you can not extend a FINAL class.
The child class needs access to the file where the parent class is defined, so you need to
include the parent file before defining the child class. Since the child class depends on it,
you should normally use require_once to include the parent file.
class ChildClass extends ParentClass { // class definition goes here }
The child class needs access to the file where the parent class is defined, so you need to
include the parent file before defining the child class. Since the child class depends on it,
you should normally use require_once to include the parent file.
Post a Comment