Mandatory

Andrei Milea
Admin
Joined: 2025-05-11 19:18:17
2025-08-07 11:25:49

βœ… 🧱 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'}



{include file='_footer.tpl'}
Never Include <html>, <head>, <body>, $smarty->display()
modula Install Digital