src/View.php
protected function getVariables()
    {
        $reflection = new ReflectionClass($this);
        foreach ($reflection->getProperties(
            ReflectionProperty::IS_PROTECTED |
            ReflectionProperty::IS_PRIVATE |
            ReflectionProperty::IS_STATIC
        ) as $property) {
            $ignore[] = $property->name;
        }
        $values = [];
        foreach ($this as $prop => $value) {
            if (!in_array($prop, $ignore)) {
                if (is_object($value)) {
                    if (method_exists($value, 'jsonSerialize')) {
                        $value = $value->jsonSerialize();
                    } elseif (method_exists($value, 'getArrayCopy')) {
                        $value = $value->getArrayCopy();
                    }
                }
                $values[$prop] = $value;
            }
        }
        return $values;
    }
protected function getVariables()
    {
        $reflection = new ReflectionClass($this);
        foreach ($reflection->getProperties(
            ReflectionProperty::IS_PROTECTED |
            ReflectionProperty::IS_PRIVATE |
            ReflectionProperty::IS_STATIC
        ) as $property) {
            $ignore[] = $property->name;
        }
        $values = [];
        foreach ($this as $prop => $value) {
            if (!in_array($prop, $ignore)) {
                if (is_object($value)) {
                    if (method_exists($value, 'jsonSerialize')) {
                        $value = $value->jsonSerialize();
                    } elseif (method_exists($value, 'getArrayCopy')) {
                        $value = $value->getArrayCopy();
                    }
                }
                $values[$prop] = $value;
            }
        }
        return $values;
    }
protected function getVariables ( ) { $ reflection = new ReflectionClass ( $ this ) ; foreach ( $ reflection -> getProperties ( ReflectionProperty :: IS_PROTECTED | ReflectionProperty :: IS_PRIVATE | ReflectionProperty :: IS_STATIC ) as $ property ) { $ ignore [ ] = $ property -> name ; } $ values = [ ] ; foreach ( $ this as $ prop => $ value ) { if ( ! in_array ( $ prop , $ ignore ) ) { if ( is_object ( $ value ) ) { if ( method_exists ( $ value , 'jsonSerialize' ) ) { $ value = $ value -> jsonSerialize ( ) ; } elseif ( method_exists ( $ value , 'getArrayCopy' ) ) { $ value = $ value -> getArrayCopy ( ) ; } } $ values [ $ prop ] = $ value ; } } return $ values ; }
Internal method to get all template variables, i.e. the public properties
on the view class.

@return array A hash of key/value pairs.
Internal method to get all template variables i . e . the public properties on the view class .