mecha-cms / mecha

Minimalist content management system.
https://mecha-cms.com
GNU General Public License v3.0
178 stars 23 forks source link

Remove `clean` Property from `$url` #162

Closed taufik-nurrohman closed 3 years ago

taufik-nurrohman commented 3 years ago

And add function arguments to current as options to include/exclude/replace query and hash part from URL.

// For `http://127.0.0.1/foo/bar/1?foo=bar&baz=qux#foo`
echo $url->current; // → `http://127.0.0.1/foo/bar/1?foo=bar&baz=qux#foo`
echo $url->current(); // → `http://127.0.0.1/foo/bar/1?foo=bar&baz=qux#foo`
echo $url->current(query: false); // → `http://127.0.0.1/foo/bar/1#foo`
echo $url->current(query: false, hash: false); // → `http://127.0.0.1/foo/bar/1`
echo $url->current(query: ['baz' => 1]); // → `http://127.0.0.1/foo/bar/1?foo=bar&baz=1#foo`