changed keyword order

This commit is contained in:
Pablo Ferreiro 2023-04-27 20:23:23 +02:00
parent e43580f3f9
commit 19a2066fc2
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
15 changed files with 41 additions and 40 deletions

View file

@ -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' . '"');
}
}