getBySlug($trip_slug); if (!$trip_data) { $this->set404(); return false; } // Set up global trip object for template compatibility global $trip; $trip = $trip_data; // Set up query vars for backward compatibility $this->setQueryVars([ 'yatra_trip_id' => $trip->id, 'yatra_trip' => $trip, 'yatra_trip_slug' => $trip_slug, 'yatra_page' => $route_data['base'] ?? SettingsService::getTripBase(), ]); // Create asset manager and render template $asset_manager = new TripAssetManager(); $template_path = TemplateRenderer::getTemplatePath('single-trip'); // Render template with global $trip already set if (!TemplateRenderer::render($template_path, [], $asset_manager)) { return false; } return true; } }