1.3 KiB
1.3 KiB
viewHelperController.php
Purpose
Central controller for page rendering and Vue component delivery. Handles both server-side rendering with templates and client-side SPA navigation.
Key Components
viewHelperControllerclassservePageFragmentUnified()methodgetDefaultDataVariables()methodgetAllViews()method
Exported Interfaces
servePageFragment()- Render page without templateservePageFragmentWithTemplate()- Render page with layout templategetDefaultDataVariables()- Get default view variablesgetAllViews()- Get all available blade views
Inputs
$page- Page identifier (route name)$data- Data payload for the page$withTemplate- Boolean to include layout template
Outputs
- HTML response with embedded navigation script
- Base64-encoded HTML for SPA
- View variables including currentUser and userModifyAdmin
Side Effects
- Renders blade templates
- Returns base64-encoded HTML for Vue navigation
Dependencies
App\Enums\UserTypesHypervel\Support\Facades\Auth,Response,FileApp\Http\Controllers\Pages\Core\ApplicationController
Notes
- Supports public and authenticated routes
- Uses viewMap config for page-to-view mapping
- Returns base64-encoded HTML for SPA navigation