class ModuleName_ModuleName_Block_Customer_Form_Login extends Mage_Customer_Block_Form_Login{
public function getPostActionUrl(){
return Mage::getUrl('modulefrontname/account/loginPost');
}
}
From this code you can also copy original block child block in new created block. Try below code to test child blocks
Changing the block type means changing the block class, so no, but...
... you can just overwrite the block:
Find a layout handle which is invoked later OR be sure, that your layout.xml is processed after the block is created, e.g. with <depends> in Company_Module.xml
Just create a new block of other type with the same name
The problem is, that this overwrites the block and does not change the type. This means everything which is done on this block between the creation and your change is lost.
<?php
class Company_Web_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
$this->loadLayout();
$this->renderLayout();
}
}
In you DO NOT have a news.xml file then in your controller you could
Best Answer
Here i change login form url without change .phtml and layout xml file.
Original login handler is
I going to change "customer_form_login" block block type
Create Controller which extend Mage_Customer_AccountController which contain loginAction()
Create block "\app\code\local\Namespace\ModuleName\Block\Customer\Form\Login.php"
From this code you can also copy original block child block in new created block. Try below code to test child blocks
Create file in "\app\design\frontend\base\default\template\customer\form\test.phtml"
Create file in "\app\design\frontend\base\default\template\customer\form\test1.phtml"
This code return error while enable cache from admin. To fixed that issue we have to comment below code
and created layout file in "\app\design\frontend\base\default\layout\layoutname.xml "
This is not best solution for me because i did not want to use .xml file. Please suggest me if any one get good solution for this issue.