Just call parent::__construct in the child.
class Form extends Tag
{
function __construct()
{
parent::__construct();
// Called second.
}
}
More Related Contents:
- How can I get the classname from a static call in an extended PHP class?
- Multiple Inheritance in PHP
- Understanding IoC Containers and Dependency Injection
- How do I get a PHP class constructor to call its parent’s parent’s constructor?
- Interface implementation: declaration must be compatible
- Writing PHP functions that has many parameters/modifiers [closed]
- What is the difference between public, private, and protected?
- PHP method chaining or fluent interface?
- Use global variables in a class
- Getter and Setter? [closed]
- Can I extend a class using more than 1 class in PHP?
- mysqli_query() expects parameter 1 to be mysqli, object given
- When to use static vs instantiated classes
- mysql_fetch_array, mysql_fetch_assoc, mysql_fetch_object
- Can you create instance properties dynamically in PHP?
- Pre-declare all private/local variables?
- In PHP, can you instantiate an object and call a method on the same line?
- What is an abstract class in PHP?
- When do I use static variables/functions in php?
- Getting static property from a class with dynamic class name in PHP
- What are the advantages of using getters and setters instead of functions or simply public fields in PHP? [closed]
- Magic __get getter for static properties in PHP
- What does the syntax ‘%s’ and ‘%d’ mean as shorthand for calling a variable?
- Is it possible to declare a method static and nonstatic in PHP?
- How to implement a decorator in PHP?
- Can I access discriminator field from php in doctrine2?
- Get all defined classes of a parent class in php
- Is Multiple Inheritance allowed at class level in PHP?
- Method Chains PHP OOP
- Best way to handle dirty state in an ORM model