# Plugin: Uncaught SmartyException: directory not allowed by security setting

**URL:** <https://forum.shopware.com/t/plugin-uncaught-smartyexception-directory-not-allowed-by-security-setting/48703>\
**Category:** Programmierung\
**Created:** [9. Oktober 2017 um 09:34 UTC](https://forum.shopware.com/t/plugin-uncaught-smartyexception-directory-not-allowed-by-security-setting/48703 "2017-10-09T09:34:05Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![Patrick\_Stahl](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/patrick_stahl/32/7679_2.png) [@Patrick\_Stahl](https://forum.shopware.com/u/Patrick_Stahl)\
**Post date:** [23. November 2017 um 07:05 UTC](https://forum.shopware.com/t/plugin-uncaught-smartyexception-directory-not-allowed-by-security-setting/48703/13 "2017-11-23T07:05:27Z")

</div>

Moin @devnullroot‍.

damit meinte ich in lediglich, dass keine Events zur Template Registrierung benutzt werden sollten, die eine Bedingung enthalten.  
**Enlight\_Controller\_Action\_PostDispatchSecure\_Frontend**

Hier ist bspw. das \_Frontend ja schon eine Bedingung, wie oben in meinem Beispiel erläutert.

Du könntest bspw. das folgende Event nutzen:  
**Theme\_Inheritance\_Template\_Directories\_Collected**  
sowie der dazugehörige Beispiel-Code:  
&nbsp;

```
public function onCollectTemplateDir(\Enlight_Event_EventArgs $args)
{
    $dirs = $args->getReturn();
    $dirs[] = $this->pluginDir . '/Views';

    $args->setReturn($dirs);
}

```

Gruß,  
Patrick&nbsp; ![Shopware](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/86c57fbace799dd4eb1f1b8a2d3bdc1733f0aea1.png "Shopware")  
&nbsp;

---

_[View the full topic](https://forum.shopware.com/t/plugin-uncaught-smartyexception-directory-not-allowed-by-security-setting/48703)._
