Can we write a block tag in our layout without its type parameter, such as below
<block name="formInput" template="Pfay/UserForm/FormInput.phtml" />
what is the other way to do this if i don't have any block associated to my template file ?
Can we write a block tag in our layout without its type parameter, such as below
<block name="formInput" template="Pfay/UserForm/FormInput.phtml" />
what is the other way to do this if i don't have any block associated to my template file ?
type
attribute is mandatory. Or you can use class
attribute instead of type
, but both of same thing:
<block class="core/template" name="left.permanent.callout" template="callouts/left_col.phtml">
...
</block>
or
<block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml">
...
</block>
See this line (/app/code/core/Mage/Core/Model/Layout.php):
protected function _generateBlock($node, $parent)
{
if (!empty($node['class'])) {
$className = (string)$node['class'];
} else {
$className = (string)$node['type'];
}
//....
}
as you want to use a template, you have to use a type, which supports templates.
The most generic type you can use for this is core/template
As already said, you have to use a type, because there is no default type. On the other side there are a lot of blocks, which dont even support templates.