changed keyword order
This commit is contained in:
parent
e43580f3f9
commit
19a2066fc2
15 changed files with 41 additions and 40 deletions
|
|
@ -2,33 +2,34 @@
|
|||
namespace App\Helpers;
|
||||
|
||||
class Misc {
|
||||
static public function getCursor(): int {
|
||||
public static function getCursor(): int {
|
||||
return isset($_GET['cursor']) && is_numeric($_GET['cursor']) ? (int) $_GET['cursor'] : 0;
|
||||
}
|
||||
|
||||
static public function getTtwid(): string {
|
||||
public static function getTtwid(): string {
|
||||
return isset($_GET['cursor']) ? $_GET['cursor'] : '';
|
||||
}
|
||||
|
||||
static public function url(string $endpoint = ''): string {
|
||||
public static function url(string $endpoint = ''): string {
|
||||
return self::env('APP_URL', '') . $endpoint;
|
||||
}
|
||||
|
||||
static public function env(string $key, $default_value) {
|
||||
public static function env(string $key, $default_value) {
|
||||
return $_ENV[$key] ?? $default_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns absolute path for view
|
||||
*/
|
||||
static public function getView(string $template): string {
|
||||
public static function getView(string $template): string {
|
||||
return __DIR__ . "/../../templates/views/{$template}.latte";
|
||||
}
|
||||
|
||||
/**
|
||||
* Common method for rss feeds
|
||||
*/
|
||||
static public function rss(string $title) {
|
||||
public static function rss(string $title) {
|
||||
header('Content-Type: application/rss+xml');
|
||||
header('Content-Disposition: attachment; filename="' . $title . '.rss' . '"');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue