public static function removeOptions($path, $options)
    {
        if (self::$renderer && (empty($path) || self::$renderer->hasOption($path))) {
            if (is_array($options)) {
                foreach ($options as $key => $value) {
                    if (is_int($key)) {
                        $callbacks = self::$renderer->getOption($path);
                        if (!is_array($callbacks) || is_callable($callbacks)) {
                            $callbacks = [$callbacks];
                        }
                        self::$renderer->setOption($path, array_filter(
                            $callbacks,
                            function ($item) use ($value) {
                                return $item !== $value;
                            }
                        ));

                        continue;
                    }

                    static::removeOptions(array_merge($path, [$key]), $value);
                }

                return;
            }

            self::$renderer->unsetOption($path);
        }
    }
public static function removeOptions($path, $options)
    {
        if (self::$renderer && (empty($path) || self::$renderer->hasOption($path))) {
            if (is_array($options)) {
                foreach ($options as $key => $value) {
                    if (is_int($key)) {
                        $callbacks = self::$renderer->getOption($path);
                        if (!is_array($callbacks) || is_callable($callbacks)) {
                            $callbacks = [$callbacks];
                        }
                        self::$renderer->setOption($path, array_filter(
                            $callbacks,
                            function ($item) use ($value) {
                                return $item !== $value;
                            }
                        ));

                        continue;
                    }

                    static::removeOptions(array_merge($path, [$key]), $value);
                }

                return;
            }

            self::$renderer->unsetOption($path);
        }
    }
public static function removeOptions ( $ path , $ options ) { if ( self :: $ renderer && ( empty ( $ path ) || self :: $ renderer -> hasOption ( $ path ) ) ) { if ( is_array ( $ options ) ) { foreach ( $ options as $ key => $ value ) { if ( is_int ( $ key ) ) { $ callbacks = self :: $ renderer -> getOption ( $ path ) ; if ( ! is_array ( $ callbacks ) || is_callable ( $ callbacks ) ) { $ callbacks = [ $ callbacks ] ; } self :: $ renderer -> setOption ( $ path , array_filter ( $ callbacks , function ( $ item ) use ( $ value ) { return $ item !== $ value ; } ) ) ; continue ; } static :: removeOptions ( array_merge ( $ path , [ $ key ] ) , $ value ) ; } return ; } self :: $ renderer -> unsetOption ( $ path ) ; } }
Cleanup previously set options.

@example Phug::removeOptions(['filters'], ['coffee' => null]])

@param array $path    option base path
@param mixed $options options to remove
Cleanup previously set options .