Jump to content

Recommended Posts

Below is my current website layout. My problem is having to do with using layouts and views. In my layout folder I have the scrpits/layout.phtml file along with a header.phtml file. I want to be able to include the header.phtml in my individual views. For some reason I have been having a hard time doing it. I have tried $this->render('header.phtml') and that didn't work. I also tried to code the full path to the file which also did not work. I keep getting Application Error in place of where the header.phtml file should be rendered. Does anybody have any ideas? I haven't added anything to my IndexController.php file and my Bootstrap.php file is also below in case you need to see it to debug anything:

 

/application

/configs

application.ini

/controllers

AboutController.php

ErrorController.php

IndexController.php

/layouts

/scripts

layout.phtml

header.phtml

/models

/views

/helpers

/scripts

/about

index.phtml

/error

index.phtml

/index

index.phtml

Bootstrap.php

/library

/public

/css

layout.css

reset.css

style.css

/images

/js

.htaccess

index.php

/tests

 

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initDoctype()
    {
        $this->bootstrap('view');
        $view = $this->getResource('view');
        $view->doctype('XHTML1_STRICT');

	$view->headTitle('Welcome to my site')->setSeparator(' :: ');

	// $view->headMeta()->setCharset('UTF-8'); // this causes my view to be blank
	$view->headMeta()->appendName('keywords', 'These are my meta keywords');
	$view->headMeta()->appendName('description', 'This is my description');

	$view->headLink()->appendStylesheet('css/reset.css')
		->headLink()->appendStylesheet('css/layout.css')
		->headLink()->appendStylesheet('css/style.css');

	$view->headScript()->appendFile('js/jquery-1.6.js')
		->headScript()->appendFile('js/cufon-yui.js')
		->headScript()->appendFile('js/cufon-replace.js')
		->headScript()->appendFile('js/Didact_Gothic_400.font.js')
		->headScript()->appendFile('js/Shanti_400.font.js')
		->headScript()->appendFile('js/roundabout.js')
		->headScript()->appendFile('js/roundabout_shapes.js')
		->headScript()->appendFile('js/jquery.easing.1.2.js')
		->headScript()->appendFile('js/script.js');
    }
}

Link to comment
https://forums.phpfreaks.com/topic/248697-quick-zend-question/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.