title: How to specify the block name in Magento?
body: <p>This is a basic question, but which drove me sleepless for the past a few days.</p>
  
  <p>I wrote a customized module with a controller, a phtml template and a block class as below:
      app/code/local/Huahan/HelloWorld/Block
          Helloworld.php  (where Huahan_Helloworld_Block_Helloworld extends Mage_Core_Block_Template)
      app/code/local/Huahan/HelloWorld/controllers
          IndexController.php  (where indexAction of index controller is defined)
      app/design/frontend/base/default/template/huahan/helloworld
          helloworld.phtml     (where view is defined)
      app/design/frontend/base/default/layout
          helloworld.xml (the filename "helloworld.xml" is specified in etc/config.xml)</p>
  
  <p>I know that every request handling in Magento starts from a controller and its action method.</p>
  
  <p>In the layout helloworld.xml, I specifies the template file in the block tag </p>
  
  <pre><code>&lt;helloworld_index_nihao&gt;
  &lt;block type="core/template" name="just_an_arbitary_name" output="toHtml" template="huahan/helloworld/nihao.phtml"/&gt;
  &lt;/helloworld_index_nihao&gt;
  &lt;/layout&gt; 
  </code></pre>
  
  <p>So the controller knows which template to use while handling request.</p>
  
  <p><strong>The problem is how I can let Magento know that Huahan_Helloworld_Block_Helloworld is the block class I want it to load before rendering any output?</strong></p>
  
  <p>And if there is any detailed documentation about the Magento xml? I am always frustrated by the complex and arbitrariness of the Magento xml syntax</p>
  
  <p>The version of Magento is ver.1.9.0.1</p>
  
  <p>The config.xml is as below</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config&gt;
  &lt;modules&gt;
  &lt;huahan_helloworld&gt;
  &lt;version&gt;
  0.1.0
  &lt;/version&gt;
  &lt;/huahan_helloworld&gt;
  &lt;/modules&gt;
  
  
  &lt;frontend&gt;
  &lt;routers&gt;
  &lt;!-- the &lt;helloworld&gt; tagname appears to be arbitrary, but by
  convention is should match the frontName tag below--&gt;
          &lt;helloworld&gt;
                  &lt;use&gt;standard&lt;/use&gt;
                  &lt;args&gt;
                          &lt;module&gt;Huahan_HelloWorld&lt;/module&gt;
                          &lt;frontName&gt;helloworld&lt;/frontName&gt;
                  &lt;/args&gt;
          &lt;/helloworld&gt;
  &lt;/routers&gt;
  
  &lt;layout&gt;
          &lt;updates&gt;
                  &lt;helloworld&gt;
                          &lt;file&gt;helloworld.xml&lt;/file&gt;
                  &lt;/helloworld&gt;
          &lt;/updates&gt;
  &lt;/layout&gt;
  &lt;/frontend&gt;
  
  &lt;global&gt;
          &lt;blocks&gt;
                  &lt;helloworld&gt;
                          &lt;class&gt;Huahan_Helloworld_block&lt;/class&gt;
                  &lt;/helloworld&gt;
          &lt;/blocks&gt;
  &lt;/global&gt;
  
  &lt;/config&gt;
  </code></pre>
  
  <p>Thanks in advance. I really appreciate that you read it down here.</p>