β π§± Mandatory Template & Controller Conventions (Modula MDK)
These rules are mandatory for every Modula system or feature built using the MDK architecture.
πΉ 1. Controller Rules (PHP)
Every controller file must include:
β At the top:
require('bootstrap.php');
user_access(); // β
Ensure user is logged in
β To render the page:
page_header("Marketplace");
page_footer("marketplace"); // β
This also renders the template
β οΈ Do not use
$smarty->display()
. It's automatically handled by page_footer("...")
.πΉ 2. Smarty .tpl
Rules (Template Files)
All .tpl
files must behave like modular components — not standalone HTML pages.
β Always start with:
{include file='_head.tpl'}
{include file='_header.tpl'}
β Always end with:
{include file='_footer.tpl'}
β Never include:
<html>
<head>
<body>
β οΈ These are handled globally by Sngine's layout system. Including them will break the layout.
β Quick Summary
File | Required |
---|---|
Controller |
require('bootstrap.php'); user_access(); page_header("Title"); page_footer("template"); |
Template (.tpl ) |
{include file='_head.tpl'} {include file='_header.tpl'} |
Never Include | <html> , <head> , <body> , $smarty->display() |