How ronaldbit/mopla works
Project type and purpose
• Mopla is a lightweight, standalone PHP template-engine library designed to cleanly separate PHP logic from HTML.
• It does not ship as a full-stack web app but as a reusable component you include in your PHP pages or frameworks.
File structure
• Top-level folders:
• src/ – core engine classes (Mopla.php, Parser.php, Filters.php, ErrorHandler.php, Utils.php)
• demo/ – example application showing integration (index.php + templates/)
• docs/ – written documentation
• No composer.json: Mopla is self-contained, no external dependencies.
• src/ follows a functional decomposition:
• Mopla.php: orchestration entry point
• Parser.php: template syntax → PHP conversion
• Filters.php: pluggable variable filters
• ErrorHandler.php: runtime error/warning capture
• Utils.php: string and helper utilities
README for additional insights
• Shows the render flow: application calls Mopla::render(template, variables)
• Lists supported directives ({if}, {for}, {set}, {include}, etc.)
• ErrorHandler provides line-level context without stopping execution