protected function replacePlaceholders($path, &$params) {
        if (strpos($path, '{') === false) {
            return $path;
        }
        $path = preg_replace_callback('/(\{([a-zA-Z0-9]+)\})/i', function($matches) use (&$params) {
            $match = $matches[1];
            $key = $matches[2];
            if (!isset($params[$key])) {
                return $match;
            }
            $replace = $params[$key];
            unset($params[$key]);
            return $replace;
        }, $path);
        return $path;
    }
protected function replacePlaceholders($path, &$params) {
        if (strpos($path, '{') === false) {
            return $path;
        }
        $path = preg_replace_callback('/(\{([a-zA-Z0-9]+)\})/i', function($matches) use (&$params) {
            $match = $matches[1];
            $key = $matches[2];
            if (!isset($params[$key])) {
                return $match;
            }
            $replace = $params[$key];
            unset($params[$key]);
            return $replace;
        }, $path);
        return $path;
    }
protected function replacePlaceholders ( $ path , & $ params ) { if ( strpos ( $ path , '{' ) === false ) { return $ path ; } $ path = preg_replace_callback ( '/(\{([a-zA-Z0-9]+)\})/i' , function ( $ matches ) use ( & $ params ) { $ match = $ matches [ 1 ] ; $ key = $ matches [ 2 ] ; if ( ! isset ( $ params [ $ key ] ) ) { return $ match ; } $ replace = $ params [ $ key ] ; unset ( $ params [ $ key ] ) ; return $ replace ; } , $ path ) ; return $ path ; }
Replace placeholders in path
@param string $path
@param array  $params
@return string
Replace placeholders in path