title: How are action methods within Magento layout xml files intended to be used
body: <p><strong>Examples</strong></p>
  
  <p>mylayoutfile.xml</p>
  
  <pre><code> &lt;layout&gt;
          &lt;default&gt;
              &lt;reference name="header"&gt;
                  &lt;block type="mynamespace_mymodule/view" name="mynamespace_mymodule" output="toHtml" template="mymodule/html/view.phtml"&gt;
                      &lt;action method="setTest"&gt;&lt;param1&gt;myparam1&lt;/param1&gt;&lt;param2&gt;myparam2&lt;/param2&gt;&lt;/action&gt;
                  &lt;/block&gt;
              &lt;/reference&gt;
          &lt;/default&gt;
      &lt;/layout&gt;
  </code></pre>
  
  <p>app/code/local/Mynamespace/Mymodule/Block/View.php</p>
  
  <pre><code>    class Mynamespace_Mymodule_Block_View extends Mage_Core_Block_Template{
          public $test = "before any params";
              public function setTest($passedparam1,$passedparam2){
               $this-&gt;test = $passedparam1 ." ". $passedparam2;
              }
  
  }
  </code></pre>
  
  <p>app/design/.../.../mymodule/html/view.phtml</p>
  
  <pre><code>&lt;?php
  echo "&lt;pre&gt;";
  print_r($this-&gt;test);  //myparam1 myparam2
  echo"&lt;/pre&gt;";
  die();
  </code></pre>
  
  <p><strong>Explanation</strong></p>
  
  <p>mylayoutfile is compiled in an update through your modules config.xml</p>
  
  <p>the block class prefix of mynamespace_module is also defined within your modules config.xml</p>
  
  <p>mynamespace_module/view is set as the block type and instantiated and the output file of view.phtml is set</p>
  
  <p>an action takes place that calls the parent node block's method setTest passing two parameters with the value of myparam1 and myparam2.</p>
  
  <p>inside of the setTest function the class parameter "test" is set to equal "myparam1 myparam2"</p>
  
  <p>the template file app/design/.../.../mymodule/html/view.phtml is loaded and we echo the value of $this->test ($this refers to the earlier instantiated block class Mynamespace_mymodule_Block_View)</p>
  
  <h2>QUESTIONS</h2>
  
  <ol>
  <li>What are some examples of use cases where this might be used?</li>
  <li>Can you pass anything other than a string? (Object,Array)?</li>
  <li>Do the automagical setters and getter methods work from inside a layout file?</li>
  <li>Can logic be used (if,then,foreach,else,etc)?</li>
  <li>Are there any scenarios where this method should not be used?</li>
  <li>Is there anything else I might be missing related to block instantiation from within a layout file?</li>
  <li>Is there anything else I might be missing related to actions from within a layout file?</li>
  </ol>