// ✅ filemtime - 파일 저장할 때마다 자동 갱신
<link rel="stylesheet" href="/css/style.css?ver=<?= filemtime(FCPATH . 'css/style.css') ?>">
// ❌ 수동 버전 - 파일 고칠 때마다 버전도 같이 손으로 올려줘야 함
<link rel="stylesheet" href="/css/style.css?ver=1.0.3">
// 파일이 존재하지 않으면 filemtime()이 false 반환 → 경고 발생
filemtime(FCPATH . 'css/없는파일.css') // ❌ Warning
// 안전하게 쓰려면
<?= file_exists(FCPATH . 'css/style.css') ? filemtime(FCPATH . 'css/style.css') : time() ?>
※ CI4에서 보통 이렇게 사용
// app/Config/App.php 에 버전 정의
public string $appVersion = '1.0.3';
// 뷰에서
<link rel="stylesheet" href="/css/style.css?ver=<?= config('App')->appVersion ?>">