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

Im developing an asp.net mvc 2 project and I would like to implement the
I am currently developing a facebook canvas (iframe) based application. Is there any way
Im developing a custom view engine for implementing themes for my asp.net mvc 2
I developing window application in C#. I created one installer with this windows application.
While developing a web app using ZF, I had an haha! moment regarding the
Developing for WM 6, I call CreateWindow with hWndParent set to the window I
Developing Java, you have always learned that its best to create an ArrayList by
While developing with Java in Eclipse it was very handy: you can attach sources
While developing a new site I stop periodically and test all new functionality in

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.