Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6784293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:58:23+00:00 2026-05-26T16:58:23+00:00

I got my headTitle up running, except i cannot echo it in my layout

  • 0

I got my headTitle up running, except i cannot echo it in my layout file as i need it for page header.

This is how i done it:

Bootstrap.php:

protected function _initDefaultHelpers() {
    $this->bootstrap('view');
    $view = $this->getResource('view');

    $view->headTitle('Awesome Website');
    $view->headTitle()->setSeparator(' - ');

My Controller:

public function indexAction() {
    $this->_helper->layout()->getView()->headTitle('IndexPage');        
}

When i open index i get: Awesome Website – IndexPage, which is perfect.

But in my master.phtml where i use:

<?php echo $this->headTitle(); ?>

Gives absolutely nothing. At this point i only want the title “IndexPage” and not the entire title, so this also has to be considered.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:58:24+00:00Added an answer on May 26, 2026 at 4:58 pm

    this work: tested by me locally after creating a new project with zend tool!

    //application.ini

    [production]
    phpSettings.display_startup_errors = 0
    phpSettings.display_errors = 0
    includePaths.library = APPLICATION_PATH "/../library"
    bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
    bootstrap.class = "Bootstrap"
    appnamespace = "Foo"
    resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
    resources.frontController.params.displayExceptions = 0
    
    ; layout stuff
    resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
    
    ; view stuff
    resources.view[] = ""
    
    [staging : production]
    
    [testing : production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    
    [development : production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    resources.frontController.params.displayExceptions = 1
    

    //into Bootstrap.php

    protected function _initDefaultHelpers() {
        $this->bootstrap('view');
        $view = $this->getResource('view');
    
        $view->headTitle('Foo');
        $view->headTitle()->setSeparator(' :: ');
        $view->doctype("XHTML1_STRICT");
    }
    

    //into layout.phtml

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="it" xml:lang="it">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    
        <?=$this->headTitle()?>
    
    </head>
    <body>
        <?=$this->pageTitle?>
        <?=$this->layout()->content?>
    
    </body>
    </html>
    

    //into view

    <? $this->pageTitle("Bar"); ?>
    

    //create view/helper/PageTitle.php

    <?
    class Zend_View_Helper_PageTitle extends Zend_View_Helper_Abstract
    {
        public function pageTitle($title)
        {
            $this->view->headTitle($title);
            $this->view->pageTitle = '<h1>' . $title . '</h1>';
        }
    }
    

    After that the name of your page will be: Foo :: Bar

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Got this error when parsing my html page using XPATH.. i am also using
Got this batch file which does exactly what I want, however I don't fully
Got this errors keeps appeared repeatedly Here is my line 20 on functions.php $wp_query->max_num_pages
Got some code that is not mine and its producing this warning atm: iehtmlwin.cpp(264)
Got a requirement to rebuild mssql full-text index. Problem is - I need to
Got a page based on Google Wave (http://wave.google.com/maintenance/index.html) but instead of clouds going left
Got two versions of a query. Neither does quite what I need.. Trying to
Got this error trying to do a new project with rails 3.2. haml issue
Got this error today while trying to build a project with checkstyle. This works
got this actionlink: <%= Html.ActionLink(Corian&reg; Worktops, Index, Corian)%> the word corian has to carry

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.