Пример #1
0
 protected function redirect($route)
 {
     $url = \Tabulate\Config::baseUrl() . '/' . ltrim($route, '/ ');
     http_response_code(303);
     header("Location: {$url}");
     exit(0);
 }
Пример #2
0
 /**
  * Get a fully-qualified URL to a Back End page for this table.
  * @param string   $action Which action to use ('index', 'import', etc.).
  * @param string[] $extra_params Other query string parameters to add.
  * @param string   $controller Which controller to use ('table', 'record', etc.).
  * @return string  The full URL.
  */
 public function getUrl($action = 'index', $extra_params = false, $controller = 'table')
 {
     $params = [];
     if (is_array($extra_params)) {
         $params = array_merge($_GET, $params, $extra_params);
     }
     $paramString = http_build_query($params);
     return Config::baseUrl() . '/table/' . $this->getName() . (!empty($paramString) ? "?{$paramString}" : "");
 }
Пример #3
0
 public function getUrl()
 {
     return Config::baseUrl() . '/record/' . $this->table->getName() . '/' . $this->getPrimaryKey();
 }