# Account Controller um Action erweitern \*best practice\*

**URL:** <https://forum.shopware.com/t/account-controller-um-action-erweitern-best-practice/28769>\
**Category:** Programmierung\
**Created:** [9. Juli 2015 um 12:44 UTC](https://forum.shopware.com/t/account-controller-um-action-erweitern-best-practice/28769 "2015-07-09T12:44:39Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![Thomas](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/thomas/32/8167_2.png) [@Thomas](https://forum.shopware.com/u/Thomas)\
**Post date:** [12. April 2017 um 06:30 UTC](https://forum.shopware.com/t/account-controller-um-action-erweitern-best-practice/28769/14 "2017-04-12T06:30:42Z")

</div>

Mit den folgenden Snippet hat es bei mir einwandfrei funktioniert.&nbsp;:-)

```
public static function getSubscribedEvents()
{
    return [
        'Enlight_Controller_Action_Frontend_Account_Test' => 'onAccountTestAction'
    ];
}

```

&nbsp;

```
public function onAccountTestAction(\Enlight_Event_EventArgs $args)
{
    /** @var Enlight_Controller_Action $subject */
    $subject = $args->getSubject();

    $subject->View()->loadTemplate( __DIR__. '/../../Views/frontend/account/test.tpl');

    $args->setReturn(true);
    return true;
}

```

&nbsp;

---

_[View the full topic](https://forum.shopware.com/t/account-controller-um-action-erweitern-best-practice/28769)._
