I'm trying to get url's from Customer Menu (My Account) from Dashboard, in a controller that extends Mage_Customer_AccountController.

enter image description here

I've tried this:

class Namespace_Module_AccountController extends Mage_Customer_AccountController

    public function logoutAction()
        $cpBlock = Mage::app()->getLayout()->createBlock('Mage_Customer_Block_Account_Navigation');

but it displays just an empty array. Any ideas to get Url's?

1 Answer 1


The links are added with layout XML (Example), not from the block class itself. So creating a new instance of the block creates the block without any links.

What you can do is load the layout handle for the customer account and then get the navigation block from the layout. Since you override the logoutAction() you probably don't want to render the layout, but you can load the layout without rendering it:

$cpBlock = Mage::app()->getLayout()->getBlock('customer_account_navigation');
  • Thx.It works :D . Jun 30, 2016 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.