<!DOCTYPE section
[
<!ENTITY % xinclude SYSTEM "../../en/xinclude.mod">
%xinclude;
<!-- Add translated specific definitions and snippets -->
<!ENTITY % language-snippets SYSTEM "../standalone/language-snippets.xml">
%language-snippets;
<!-- Fallback to English definitions and snippets (in case of missing translation) -->
<!ENTITY % language-snippets.default SYSTEM "../../en/standalone/language-snippets.xml">
%language-snippets.default;
]>
<section id="modules.layouts">
<title>Layouts</title>
<para>
A <emphasis>layout</emphasis> is an <acronym>HTML</acronym> file that provides the markup
for the overall look of a page. A layout is generally used to implement headers and footers,
specify which stylesheets and scripts to use, and define the locations for content and
regions. Layouts can include <acronym>PHP</acronym> code. Place layouts in the
<filename>layouts/scripts</filename> folder under your module's folder. Assign filenames
using the format <emphasis>layoutname</emphasis>-layout.phtml.
</para>
<para>
For the system to function correctly, your layout needs to output the various scripts,
<acronym>CSS</acronym>, metadata, etc. that modules have registered. This is generally
accomplished by using the following template:
</para>
<programlisting language="php">
<?= $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?= $this->headMeta() ?>
<?= $this->headTitle() ?>
<?= $this->dojo() ?>
<?= $this->headLink() ?>
<?= $this->headScript() ?>
<?= $this->headStyle() ?>
</head>
<body class='claro
<?= $this->layout()->getLayout() ?>
<?= $this->request()->getModuleName() ?>-module
<?= $this->request()->getControllerName() ?>-controller
<?= $this->request()->getActionName() ?>-action'>
<div id="content">
<?= $this->layout()->content ?>
</div>
<?= $this->toolbar() ?>
<?= $this->notifications() ?>
</body>
</html>
</programlisting>
<para>
For details, see <xref linkend="themes.layouts"/> and the
<ulink url="http://framework.zend.com/manual/1.11/en/zend.layout.html">Zend
Framework documentation</ulink>.
</para>
</section>
<!--
vim:se ts=4 sw=4 et:
-->