<block type="page/html" name="root" output="toHtml" template="example/view.phtml">
page is a FrontendName defined in etc/config.xml
file
html is a block class name
more details:
in this line type(type="page/html")
define block class name related to your template(template="example/view.phtml">)
and name is the unique for each block.
first see folder structure
app>local>namespace>modulename>etc>config.xml
we set FrontendName = 'mymodule'
app>local>namespace>modulename>Block>hello.php
in hello.php you created a function
class namespace_modulename_Block_Data extends Mage_Core_Block_Template
{
public function mydata()
{
$data = "Block is called";
return $data;
}
}
and now come to your layout xml page:
<block type="mymodule/data" name="xyz" template="example/view.phtml">
here mydata is frontend name
and now come to your template's
template/example/view.phtml page
here you can call directly mydata() function
like
<div>
<?php echo $this->mydata(); ?>
</div>
now you can get your output in browser
"Block is called"