Reputation: 4450
In my index/index
action, I'm calling a form class that I created, and output the form in the index.phtml
view like this
<?php
echo $this->form;
But when I view the page source, all I'm getting is the form markup. I don't get any HTML HEAD BODY
tags to make this a valid markup page. How do I add these to all my pages?
I have layouts/scripts/layout.phtml
but I'm not sure what's the correct way to use it.
Upvotes: 0
Views: 109
Reputation: 14184
It sounds like you have not enabled the layouts.
The typical way to so this is via your configs/application.ini file:
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.layout.layout = "layout"
The file application/layouts/scripts/layout.phtml
should have the html code for your template, typically employing (as noted in the answer by @Alkexander) the view-helpers headLink()
, headScript()
, etc.
See Zend Framework: Documentation: Using Zend_Layout
Upvotes: 3
Reputation: 21947
Use common layout. In this layout with help of View Helpers create doctype, head...
$this->getHead('jquery');
$this->headLink()->appendStylesheet('/styles/common.css');
echo $this->headTitle();
echo $this->headMeta();
echo $this->headScript();
echo $this->headLink();
echo $this->headStyle();
Upvotes: 1