Scope article feeds and expand canvas editing
This commit is contained in:
@@ -65,6 +65,20 @@ final class View
|
||||
return $value ? date($format, strtotime($value)) : '';
|
||||
}
|
||||
|
||||
public static function alignmentClass(?string $alignment): string
|
||||
{
|
||||
return in_array($alignment, Html::ALIGNMENTS, true) ? ' studio-align-' . $alignment : '';
|
||||
}
|
||||
|
||||
public static function archivePage(string $path, int $page): string
|
||||
{
|
||||
if ($page === 1) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
return $path . (str_contains($path, '?') ? '&' : '?') . 'page=' . $page;
|
||||
}
|
||||
|
||||
public static function redirect(string $path, int $status = 303): Response
|
||||
{
|
||||
return new Response($status, ['Location' => $path, 'Cache-Control' => $status === 301 ? 'public, max-age=300' : 'no-store'], '');
|
||||
|
||||
Reference in New Issue
Block a user