learning-center/app/SharedKernel/File/Controllers/DeleteController.php

18 lines
358 B
PHP
Raw Normal View History

2024-09-08 13:48:26 +03:00
<?php
declare(strict_types=1);
namespace App\SharedKernel\File\Controllers;
use App\SharedKernel\File\Models\FileRepository;
final class DeleteController extends \Phalcon\Mvc\Controller
{
public function mainAction($id): void
{
(new FileRepository())->get($id)->delete();
$this->response->redirect($_GET['redirect_to']);
}
}