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.
Installs: 143 059
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Type:mouf-library
Requires
- php: ^8.0
- mouf/html.template.templateinterface: ^3.0
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();