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 3316524
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:28:46+00:00 2026-05-17T22:28:46+00:00

I am developing a Zend MVC application. Sometimes I like to echo some text

  • 0

I am developing a Zend MVC application.

Sometimes I like to echo some text just for quick and dirty debugging. e.g

<?php
class MyClass {}
echo('hello world - yes this script is included');

I can echo ‘debug-text’ in my bootstrap> But, when text is echoed in my model or controllers it is NOT being rendered in the output.

I am using Zend 1.9.5 and using Zend Layout with MVC


Is there a setting somewhere that is suppressing all ”non-view script rendered” output?

  • 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-17T22:28:47+00:00Added an answer on May 17, 2026 at 10:28 pm

    I am answering this question because I came back to the same code , 10 months later , and it confused me again.

    I was in the context of a Default Module, Index Controller, and Index Action.

    I wanted to echo some simple text as a quick way to see what was happening in the code:

    class IndexController extends Zend_Controller_Action
     {
    
     public function indexAction()
      {
      //home page
      echo '<h1>hello world</h1>';
    
      //set the special home page layout
      $this->_helper->layout()->setLayout('home-page');
      }
    

    Trouble was – the echoed text was just not showing up.

    It worked in other controllers , but not this one. It was driving me crazy.

    Now – I’ve worked out the problem.

    I was using a special layout for this particular control action… a ‘home page layout’.

    In my home page layout I was not rendering any view script. All the content and design was in the layout. Because the home page is a special , unique page, there was no need to separate into a two step view. For this reason I had no reason to need a view script. But, I did create a ‘views\scripts\index\index.phtml’ to keep ZF from complaining. I did not however, render it in my layout – cos it was not needed.

    Any echoed output is captured into the layout()->content (automatically assigned by the layout from the ‘default’ response segment). Because I was not echoing out that segment, it behaved as if the echoed text was being suppressed.

    To solve the problem , i simply had to ensure that i was echoing out the content segment.

    i.e.

    <html>
    <head>
    ...
    </head>
    <body>
    ... my home page html...
    <?php echo $this->layout()->content ?>
    ... my home page html...
    </body>
    </html>
    

    which, with my debug text being echoed too… would render as:

    ... my home page html...
    <h1>hello world</h1>
    ... my home page html...      
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a website in PHP and I would like to use a
I'm developing a zend framework application that includes a simple email function. The development
I'm developing a zend framework app that's just going to act as a web
I am developing a web-app using zend framework. I like how all the autoloading
Im developing an asp.net mvc 2 project and I would like to implement the
Developing a .NET WinForms application: how can I check if the window is in
Developing a heavily XML-based Java-application, I recently encountered an interesting problem on Ubuntu Linux.
Developing a website and just trying to get back into the swing of (clever)
When developing a desktop application in .NET, is it possible to not require the
When developing a new web based application which version of html should you aim

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.