Toolvana: production-ready media tools platform (CodeIgniter 4)
- 134-tool registry with programmatic SEO (unique titles/H1/descriptions, JSON-LD graphs, sitemap index, canonical 301 enforcement via required filter) - DB-backed job queue (SKIP LOCKED) with drivers: Ffmpeg, Images (GD), Pdf (qpdf/gs/poppler), Youtube (thumbnails), Qr (server-side PNG) - Security: SSRF guard, MIME validation, rate limits, API-key auth, bcrypt admin login, security headers - Admin panel: dashboard, tools/categories/guides CRUD, SEO audit, analytics, job inspector with retry, system health, feature flags - Docker deployment (nginx + web/api FPM pools + scalable workers), PHPUnit suite (19 tests / 1139 assertions), PWA manifest + service worker
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
/**
|
||||
* Crawlable search results page: /search?q=...
|
||||
*/
|
||||
final class Search extends BaseController
|
||||
{
|
||||
public function index(): string
|
||||
{
|
||||
$q = trim((string) $this->request->getGet('q'));
|
||||
$finder = service('finder');
|
||||
|
||||
$results = [];
|
||||
if ($q !== '') {
|
||||
$results = service('toolSearch')->find($q, 20);
|
||||
service('analytics')->track('search', ['meta' => ['term' => mb_substr($q, 0, 80)]]);
|
||||
}
|
||||
|
||||
$this->seo->title($q !== '' ? "Search: {$q}" : 'Search Tools')
|
||||
->description('Search across all free media tools.')
|
||||
->canonical('/search')
|
||||
->noIndex()
|
||||
->breadcrumbs([['label' => 'Search']]);
|
||||
|
||||
return $this->render('search', [
|
||||
'query' => $q,
|
||||
'results' => $results,
|
||||
'popular' => $finder->popular(6),
|
||||
'categories'=> $finder->categories(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user