where('modelos_visibility', 'public'); } $modelos = $query->orderBy('modelos_order', 'asc')->get(); return $this->renderView('@modelo/public/index.twig', [ 'page_title' => 'Nossos Modelos', 'modelos' => $modelos ]); } /** * Show a single Modelo by slug */ public function show(Request $request, string $slug): Response { if (!defined('PUBLIC_MODELO_ACCESS')) { define('PUBLIC_MODELO_ACCESS', true); } $modelo = Modelo::where('modelos_slug', $slug) ->where('modelos_active', true) ->first(); if (!$modelo) { return new Response('Modelo não encontrado', 404); } // Replace placeholders $content = $modelo->modelos_content; $content = str_replace('[site_name]', $_SESSION['bus_name'] ?? 'SysCMS', $content); $content = str_replace('[current_date]', date('d/m/Y'), $content); $content = str_replace('[contact_email]', $_SESSION['bus_email'] ?? 'contato@syscms.com', $content); return $this->renderView('@modelo/public/show.twig', [ 'page_title' => $modelo->modelos_title, 'modelo' => $modelo, 'content' => $content ]); } }