Hi!
I am trying to create a custom page in front office via custom module.
Here is a minimal example:
mk_formpage/
├── mk_formpage.php
├── controllers/
│ └── front
│ └── display.php
└── views/
└── templates
└── front
└── display.tpl
> display.php:
<?php
class mk_formpagedisplayModuleFrontController extends ModuleFrontController{
public function initContent(){
parent::initContent();
$this->setTemplate('module:mk_formpage/views/templates/front/display.tpl');
}
}
I can generate page using simple template:
> display.tpl:
<!doctype html>
<!-- Note: this is just a fragment, it will not work -->
<head>
{block name='head}
{include file='_partials/head.tpl'}
{/block}
</head>
<body>
Here my content
{block name='javascript_bottom'}
{hook h='...ClosingTag'}
</body>
</html>
What I can't get to work is using more general templates:
> display.tpl variation:
{extends file='page.tpl'}
{block name="page_content"}
Here my content
{/block}
The error I am getting is:
ContextErrorException in smarty_internal_templatebase.php(157) : eval()'d code line 445:
Warning: htmlspecialchars() expects parameter 1 to be string, array given
I have tried to debug this but without any luck.
Docs are actually harmful since those are outdated
Any help is appreciated!