The FO Smarty templates
We saw in Chapter 3, The Front Office, that the initContent()
method of the front controllers was fetching the Smarty template of the active theme, with this code in the CMS FO controller example:
$this->setTemplate( 'cms/page', ['entity' => 'cms', 'id' => $this->cms->id] );
In this example, the code will fetch the /themes/classic/templates/cms/page.tpl
file to generate the HTML view for the CMS page FO controller.
Remember that if you are not familiar with Smarty, you can go to the official documentation website via this URL: https://www.smarty.net/documentation.
Let’s study the code of this template example:
{extends file='page.tpl'}
This line tells Smarty that this view is a child of the /themes/classic/templates/page.tpl
file (the parent view). The following lines in this child template override the parent view:
{block...