mouf/html.template.mouftemplate

This package contains a template for the Mouf administration interface. The content is automatically adjusted to the website page to use all the width. Anyway, you can use this component as a model if you like.

v2.1.0 2022-12-08 15:26 UTC

This package is auto-updated.

Last update: 2024-12-08 20:21:00 UTC


README

MoufTemplate is the HTML template used for the Mouf project.

It is obviously a Mouf package, and extends the Mouf TemplateInterface. This means that if you are using Mouf, you can use the MoufTemplate in every place you would need a template implementing the TemplateInterface.

MoufTemplate has 5 zones: content, top, left, right and bottom. Fill these zones using the Mouf UI.

Here is a sample code:

<?php 
// Let's import all required classes
use Mouf\Html\Template\MoufTemplate\MoufTemplate;
use Mouf\Html\HtmlElement\HtmlBlock;

define ('ROOT_URL', "/composertest/");

require_once 'vendor/autoload.php';

// WARNING! this code is only to explain the inner workings of the MoufTemplate class
// Usually, you would never create a new instance of MoufTemplate, nor would you create 
// the $contentBlock or $leftBlock variables.
// Those are created and injected by Mouf, for you.

// Let's define the main content block
$contentBlock = new HtmlBlock();
$contentBlock->addText("Hello world!");

// Let's define the left content block
$leftBlock = new HtmlBlock();
$leftBlock->addText("My left menu!");

// Let's display the template
$template = new MoufTemplate();
$template->setContent($contentBlock);
$template->setLeft($leftBlock);
$template->toHtml();