title: how to call block method from magento 1 template
body: <p>I'm new to magento and always have issues.</p>
  
  <p>For now, I managed to add subscribe popup message and want to add a child block to my main block.</p>
  
  <p>Code:(my custom module is <code>My_Module</code>)</p>
  
  <pre><code>&lt;reference name="before_body_end"&gt;
      &lt;block type="newsletter/subscribe" name="newsletter_popup" as="newsletter_popup" template="popup/subscribe.phtml"&gt;
          &lt;block type="Module/popup_newsletter" name="newsletter11" /&gt;
      &lt;/block&gt;
  &lt;/reference name="before_body_end"&gt;
  </code></pre>
  
  <p>and in <code>subscribe.phtml</code> I try the following:</p>
  
  <pre><code>var_dump($this-&gt;getChildHtml('newsletter11'))
  </code></pre>
  
  <p>but the result is:</p>
  
  <blockquote>
    <p>string(0)""</p>
  </blockquote>
  
  <p>I tried to load the block from template in this way also:</p>
  
  <pre><code>var_dump($this-&gt;getLayout()-&gt;createBlock('module/popup_newsletter'));
  </code></pre>
  
  <p>but the result is <code>boolean(false).</code></p>
  
  <p>what I want to do is call a method from child block (<code>Newsletter.php</code>) and this out put some text, this block for now has these two methods:</p>
  
  <pre><code>puplic function test(){
      return 'this is test';
  }
  
  public function _toHtml()
  {
      return test();
  }
  </code></pre>
  
  <p>I can't see were is my mistake.</p>
  
  <p>Can any one help me thankfully, I don't know if you need more code to post. Just let me know if you need </p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>update:</strong>
  config.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;config&gt;
      &lt;modules&gt;
          &lt;My_Module&gt;
              &lt;version&gt;1.0.1&lt;/version&gt;
          &lt;/My_Module&gt;
      &lt;/modules&gt;
  
      &lt;global&gt;
          &lt;models&gt;
              &lt;my_module&gt;
                  &lt;class&gt;My_Module_Model&lt;/class&gt;
              &lt;/my_module&gt;
          &lt;/models&gt;
          &lt;helpers&gt;
              &lt;my_module&gt;
                  &lt;class&gt;My_Module_Helper&lt;/class&gt;
              &lt;/my_module&gt;
          &lt;/helpers&gt;
          &lt;blocks&gt;
              &lt;my_module&gt;
                  &lt;class&gt;My_Module_Block&lt;/class&gt;
              &lt;/my_module&gt;
          &lt;/blocks&gt;
      &lt;/global&gt;
  &lt;frontend&gt;
      &lt;routers&gt;
          &lt;My_Module&gt;
              &lt;use&gt;standard&lt;/use&gt;
              &lt;args&gt;
                  &lt;module&gt;My_Module&lt;/module&gt;
                  &lt;frontName&gt;my&lt;/frontName&gt;
              &lt;/args&gt;
          &lt;/My_Module&gt;
      &lt;/routers&gt;
      &lt;/frontend&gt;
  </code></pre>