KMP PHP API Reference

AppView extends View
in package
uses UIViewTrait

Application View

Base view class for the Kingdom Management Portal (KMP) application. Extends CakePHP's View class with Bootstrap UI integration and KMP-specific helper loading.

This class serves as the foundation for all views in the KMP system, providing consistent initialization of:

  • UI framework integration (Bootstrap)
  • Asset management helpers
  • Authentication helpers
  • KMP-specific utilities
  • Image processing capabilities

Key Features:

  • Automatic Bootstrap UI integration via UIViewTrait
  • Asset versioning through AssetMix
  • User authentication context via Identity helper
  • Image processing with Glide
  • Custom KMP helper for application-specific components

Usage: This view is automatically used by all controllers unless explicitly overridden. All helpers loaded here are available in templates without additional loading.

Helper Dependencies:

  • AssetMix.AssetMix: Asset compilation and versioning
  • Authentication.Identity: User authentication context
  • Bootstrap.Modal: Modal dialog components
  • Bootstrap.Navbar: Navigation components
  • Kmp: Custom KMP-specific helper
  • ADmad/Glide.Glide: Image processing and optimization
  • Tools.Format: Text formatting utilities
  • Tools.Time: Time formatting utilities
  • Templating.Icon: Icon rendering utilities
  • Templating.IconSnippet: Icon snippet utilities

Configuration Notes:

  • Glide is configured for image processing with secure URLs
  • Bootstrap UI is initialized without layout override
  • All helpers are loaded during initialization
Tags
link
https://book.cakephp.org/4/en/views.html#the-app-view
see
UIViewTrait

For Bootstrap integration

see
KmpHelper

For KMP-specific functionality

Table of Contents

Methods

initialize()  : void
Initialization hook method.

Methods

initialize()

Initialization hook method.

public initialize() : void

Automatically called when the view is instantiated. Sets up all the helpers and UI components needed for KMP templates.

Initialization Process:

  1. Calls parent initialization
  2. Initializes Bootstrap UI framework integration
  3. Loads core CakePHP helpers for assets and authentication
  4. Loads Bootstrap-specific helpers for UI components
  5. Configures Glide for image processing
  6. Loads additional utility helpers

Helper Loading Order:

  • AssetMix: Must be loaded early for asset management
  • Identity: Required for permission checks in templates
  • Bootstrap components: For consistent UI rendering
  • KMP helper: For application-specific functionality
  • Glide: For responsive image processing
  • Utility helpers: For formatting and display

Configuration Details:

  • UIViewTrait is initialized without layout override to maintain flexibility
  • Glide is configured with secure URLs and image base path
  • All helpers are immediately available in templates after initialization
Tags
throws
Exception

If helper loading fails


        
On this page

Search results