Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/callback get url #271

Merged
merged 2 commits into from
Nov 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,17 @@ protected function getRequestURI()
/**
* Build a URL that application can use for call-backs.
*
* @param array|string $page URL as string or array with page name as first element and other GET arguments
* @param array|string $page URL as string or array with page name as first element and other GET arguments
* @param bool $needRequestUri Simply return $_SERVER['REQUEST_URI'] if needed
*
* @return string
*/
public function url($page = [])
public function url($page = [], $needRequestUri = false)
{
if ($needRequestUri) {
return $_SERVER['REQUEST_URI'];
}

$sticky = $this->sticky_get_arguments;
$result = [];

Expand Down
6 changes: 1 addition & 5 deletions src/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ public function triggered()
*/
public function getURL($mode = 'callback')
{
if ($this->POST_trigger) {
return $_SERVER['REQUEST_URI'];
}

return $this->app->url([$this->name => $mode]);
return $this->app->url([$this->name => $mode], $this->POST_trigger);
}
}