-
-
Notifications
You must be signed in to change notification settings - Fork 88
Closed
Description
I cannot use class Nette\HttpUrlScript "smoothly", as standalone (its needed for me for extending of Nette\Http\Request class).
For example:
$url = new \Nette\Http\UrlScript("http://nette.org/admin/script.php/pathinfo/?name=param#fragment");
echo $url->basePath; // expected '/admin/', but output is '/'My suggestions:
You can specify in the constructor the minimum default functionality, suitable for most cases. My simple example:
class UrlScript extends Url
{
...
public function __construct($url = NULL)
{
parent::__construct($url);
$this->scriptPath = $this->path;
}
...
}With this patch any descendant class of UrlScript (if its instance was created standalone, not from RequestFactory), will have same behavioral as the class Url (in method getBasePath, getRelativeUrl and other).
Metadata
Metadata
Assignees
Labels
No labels