Posted by Sjoerd on 05/31/06 14:25
Markus Ernst wrote:
> In order to make static class variables accessible in a clean way I try
> to write a method in the base class, as shown in this example:
You probably mean private/protected instead of static.
> <?php
> class childclass
> {
> var $types = array('text', 'password', 'hidden');
> function get_types() {
> return $types;
> }
> }
>
> print_r(childclass::get_types());
> ?>
The variable $types does not exist until an instance of this class is
made:
$foo = new childclass();
$foo->get_types();
Navigation:
[Reply to this message]
|