0

I created a module that add a link inside customer account navigation. My controller is like this

public function indexAction() {
    $this->loadLayout();
    $this->renderLayout();
}

public function testAction() {
    $this->loadLayout();
    $this->renderLayout();
}

If I go to /customer/mymodule/index I can see correctly the layout with my own .phtml specified inside the .xml.

Now I would like to assign to customer/mymodule/test another file .phtml with always the left account customer navigation as inside the index action.

Thanks

3
  • Did you try using a layout.xml for your module Commented Sep 23, 2014 at 21:59
  • what is mean by "customer navigation as inside the index action".
    – Amit Bera
    Commented Sep 24, 2014 at 1:19
  • @AmitBera in testAction I want the same layout of indexAction. Thanks Commented Sep 24, 2014 at 5:32

1 Answer 1

1

The update layout tag allows you to call another layout handle in your current handle. I suggest that this is what you are looking for. It will allow you to use the exact same layout as in the index action and then make any changes that you need.

<your_first_handle>
    <!-- some layout goes here -->
</your_first_handle>

<your_second_handle>
    <update handle="your_first_handle" />
    <!-- any layout for the second handle can go here -->
</your_second_handle>

Your Answer

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

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